{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/12281","labels_url":"https://api.github.com/repos/golang/go/issues/12281/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12281/comments","events_url":"https://api.github.com/repos/golang/go/issues/12281/events","html_url":"https://github.com/golang/go/issues/12281","id":102638258,"number":12281,"title":"cmd/compile: cgo flags drops quotes.","user":{"login":"omeid","id":1453118,"avatar_url":"https://avatars.githubusercontent.com/u/1453118?v=3","gravatar_id":"","url":"https://api.github.com/users/omeid","html_url":"https://github.com/omeid","followers_url":"https://api.github.com/users/omeid/followers","following_url":"https://api.github.com/users/omeid/following{/other_user}","gists_url":"https://api.github.com/users/omeid/gists{/gist_id}","starred_url":"https://api.github.com/users/omeid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omeid/subscriptions","organizations_url":"https://api.github.com/users/omeid/orgs","repos_url":"https://api.github.com/users/omeid/repos","events_url":"https://api.github.com/users/omeid/events{/privacy}","received_events_url":"https://api.github.com/users/omeid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-23T17:00:10Z","updated_at":"2015-08-23T17:00:10Z","closed_at":null,"body":"There doesn't seem to be a way to pass a quoted value with cgo flags.\r\n\r\n```go\r\npackage libsass\r\n\r\n/*\r\n#cgo CFLAGS: -D VERSION=\"3.2.4-0ae11a4\"\r\n\r\n\r\nchar* version(void) {\r\n  return VERSION;\r\n}\r\n*/\r\nimport \"C\"\r\n\r\nfunc Version() string {\r\n\treturn C.GoString(C.version())\r\n}\r\n```\r\n```sh\r\n$ go build -x -v\r\nWORK=/tmp/go-build030587731\r\ntest/cgoflag\r\nmkdir -p $WORK/test/cgoflag/_obj/\r\nmkdir -p $WORK/test/cgoflag/_obj/exe/\r\ncd /home/ome/go/src/test/cgoflag\r\nCGO_LDFLAGS=\"-g\" \"-O2\" /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/test/cgoflag/_obj/ -importpath test/cgoflag -- -I $WORK/test/cgoflag/_obj/ -D VERSION=3.2.4-0ae11a4 main.go\r\n# test/cgoflag\r\n./main.go: In function 'version':\r\n<command-line>:0:9: error: too many decimal points in number\r\n./main.go:8:10: note: in expansion of macro 'VERSION'\r\n   return VERSION;\r\n          ^\r\n<command-line>:0:15: error: invalid suffix \"ae11a4\" on integer constant\r\n./main.go:8:10: note: in expansion of macro 'VERSION'\r\n   return VERSION;\r\n```\r\nI have also tried `'\"3.2.4-0ae11a4\"'` and some other variations, they all yield:\r\n`can't load package: package test/cgoflag: /home/ome/go/src/test/cgoflag/main.go: malformed #cgo argument: VERSION=\"3.2.4-0ae11a4\"`"}}