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: warning in 1.8Beta that is not seen in previous versions #18298

Closed
gazed opened this issue Dec 13, 2016 · 2 comments

Comments

@gazed
Copy link

commented Dec 13, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

    Tested using golang 1.7.4 & golang 1.8Beta1 

What operating system and processor architecture are you using (go env)?

    MacPro 2013 base model. OSX 10.12 (clang) and (Bootcamp) Windows 10 (gcc 5.1.0).

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

"go install" the following file to recreate the error.
https://github.com/gazed/vu/blob/master/render/gl/gl.go
lines 1131 and 1134 compiled with no warnings in all previous versions of Go.

What did you expect to see?

~/code/src/vu (master): go version
go version go1.7.4 windows/amd64
~/code/src/vu (master): go install vu/render/gl
~/code/src/vu (master):

What did you see instead?

The warning seems to incorrectly complain that "argument is of type 'void * const*'".

~/code/src/vu (master): go version
go version go1.8beta1 windows/amd64
~/code/src/vu (master): go install vu/render/gl
# vu/render/gl
cgo-gcc-prolog: In function '_cgo_8d303d926b5a_Cfunc_wrap_glMultiDrawElements':
cgo-gcc-prolog:4926:48: warning: passing argument 4 of 'wrap_glMultiDrawElements' from incompatible pointer type [-Winco mpatible-pointer-types]
render\gl\gl.go:1131:22: note: expected 'const void * const*' but argument is of type 'void * const*'
// GLAPI void APIENTRY wrap_glMultiDrawElements(unsigned int mode, const int* count, unsigned int t_ype, const void* co nst* indices, int drawcount) { (pfn_glMultiDrawElements)((GLenum)mode, (const GLsizei )count, (GLenum)t_ype, (const G Lvoid const )indices, (GLsizei)drawcount); }
^
cgo-gcc-prolog: In function '_cgo_8d303d926b5a_Cfunc_wrap_glMultiDrawElementsBaseVertex':
cgo-gcc-prolog:4946:58: warning: passing argument 4 of 'wrap_glMultiDrawElementsBaseVertex' from incompatible pointer ty pe [-Wincompatible-pointer-types]
render\gl\gl.go:1134:22: note: expected 'const void * const
' but argument is of type 'void * const
'
// GLAPI void APIENTRY wrap_glMultiDrawElementsBaseVertex(unsigned int mode, const int* count, unsigned int t_ype, cons t void* const* indices, int drawcount, const int* basevertex) { (*pfn_glMultiDrawElementsBaseVertex)((GLenum)mode, (con st GLsizei )count, (GLenum)t_ype, (const GLvoid const *)indices, (GLsizei)drawcount, (const GLint *)basevertex); }
^

@ianlancetaylor ianlancetaylor changed the title Cgo issues warning in 1.8Beta that is not seen in previous versions. cmd/cgo: warning in 1.8Beta that is not seen in previous versions Dec 13, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.8 milestone Dec 13, 2016
@ALTree

This comment has been minimized.

Copy link
Member

commented Dec 13, 2016

Probably introduced by the fix for #17537

@gopherbot

This comment has been minimized.

Copy link

commented Dec 13, 2016

CL https://golang.org/cl/34370 mentions this issue.

@gopherbot gopherbot closed this in 10f3b09 Dec 14, 2016
@golang golang locked and limited conversation to collaborators Dec 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.