Skip to content
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: detect misuse of the generated _cgo_export.h #9742

Closed
minux opened this issue Jan 30, 2015 · 0 comments
Closed

cmd/cgo: detect misuse of the generated _cgo_export.h #9742

minux opened this issue Jan 30, 2015 · 0 comments
Milestone

Comments

@minux
Copy link
Member

minux commented Jan 30, 2015

By misuse, I mean using the file generated for another architecture, esp. when size of GoInt differs.

Two possible solutions:

  1. Add #ifndef __x86_64__ and #error to make sure it is only built with the correct platform. Or we can relax a bit and check for sizeof(GoInt) == sizeof(void *).
  2. Define size of GoInt to be sizeof(void*). This is true for all supported platforms.

Opinions?

@minux minux added this to the Go1.5 milestone Jan 30, 2015
@minux minux closed this as completed in 3819907 Feb 6, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants