]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: mention character restrictions on #cgo lines
authorIan Lance Taylor <iant@golang.org>
Tue, 26 Jun 2018 13:40:26 +0000 (06:40 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 26 Jun 2018 14:39:02 +0000 (14:39 +0000)
Fixes #26025

Change-Id: I43b3c9019ca8d2844e4d664c2090e506b2171077
Reviewed-on: https://go-review.googlesource.com/120975
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/cgo/doc.go

index 332b5670cc090fd322284987c125ce23a2817787..4bd82ebd12462543a125651846d6e4f7fa3a150c 100644 (file)
@@ -64,6 +64,11 @@ a full argument: to allow -mfoo=bar, use CGO_CFLAGS_ALLOW='-mfoo.*',
 not just CGO_CFLAGS_ALLOW='-mfoo'. Similarly named variables control
 the allowed CPPFLAGS, CXXFLAGS, FFLAGS, and LDFLAGS.
 
+Also for security reasons, only a limited set of characters are
+permitted, notably alphanumeric characters and a few symbols, such as
+'.', that will not be interpreted in unexpected ways. Attempts to use
+forbidden characters will get a "malformed #cgo argument" error.
+
 When building, the CGO_CFLAGS, CGO_CPPFLAGS, CGO_CXXFLAGS, CGO_FFLAGS and
 CGO_LDFLAGS environment variables are added to the flags derived from
 these directives. Package-specific flags should be set using the