-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/cgo: cgo is broken with gcc -fdiagnostics-color #40415
Comments
The cgo tool doesn't really do string analysis of error messages. It just uses the file name and line number. But it does look for the literal string |
Well, I merely said "string analysis of compiler output", I'd say it counts if it is using string analysis of compiler output to find the literal string
The |
How about removing the ANSI escape directly, then cgo can return the error message successfully? |
That sounds like more work than extending existing functionality for filtering unwanted options. But I suppose that would equally do the trick. |
Change https://golang.org/cl/248398 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.14.6 linux/amd64
Does this issue reproduce with the latest release?
see above
What operating system and processor architecture are you using (
go env
)?see above
What did you do?
In any project, compile cgo stuff using
CGO_CFLAGS='-fdiagnostics-color' go build
What did you expect to see?
A successful compile
What did you see instead?
Further info
go/src/cmd/cgo/gcc.go
Lines 372 to 450 in a5a9a06
Compiling code with gcc seems to be doing string analysis of compiler output with "expected errors". It fails if the output contains ANSI escape sequences due to the compiler emitting color output. The error message is incredibly vague and doesn't inform the user that an internal implementation detail of the compiler has dumped its internals all over the screen.
This test should probably do more filtering of options around
go/src/cmd/cgo/gcc.go
Line 1977 in a5a9a06
The text was updated successfully, but these errors were encountered: