-
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: inline functions produce link errors #17356
Comments
The .go source file contains:
I think this is causing one part of the compile to think the function is inlined and so omitting the symbol in the object file, but obviously when I'm not actually sure if this is supposed to work or not. I'm fairly sure it would be resolved by removing the "inline" designation from the functions in that file /cc @ianlancetaylor |
Why are the clang invocations using the option |
Oh, sorry, my apologies, it is in github.com/svent/sift/matching_cgo.go, I missed that. |
I can recreate the problem on GNU/Linux if I used |
Because the package is being compiled in C99 mode, a function that is plain This is an issue that occurs in plain C as well. It has nothing to do with Go as such. The code only works if the compiler decides to inline all functions. The simple fix is to change the comment in the matching_cgo.go to use Closing because there is nothing to fix in Go. |
Thx for the explanation @ianlancetaylor |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?macOS Sierra
What did you do?
What did you expect to see?
Installed sift
What did you see instead?
The text was updated successfully, but these errors were encountered: