-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: confusing error when using cgo with Go assembly code #19448
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
Comments
In retrospect perhaps we should have always assembled Generating a more meaningful error message sounds good, but I'm not sure how. I'm open to suggestions. |
What do you think of adding a new suffix for code to be always assembled by the Go assembler? Like |
I can't say that I'm particularly fond of it, but I suggest that you send a message to the golang-dev mailing list and see what people think about the idea. |
I'm loathe to introduce new semantics here when we've gotten this far without them. But I will add a heuristic test to produce a better error in this case. |
CL https://golang.org/cl/46423 mentions this issue. |
Currently if a package has a
import "C"
all.s
files will be compiled by the C compiler, which of course rejects Go assembly.I suspect this is asking too much, but it would be useful if there was a way to still compile assembly files with the Go assembler in a cgo package.
As a lower bar, it would be useful to get more meaningful error messages, as syntax errors appearing when adding
import "C"
in a different file are pretty obscure.The text was updated successfully, but these errors were encountered: