-
Notifications
You must be signed in to change notification settings - Fork 100
imguiWrapperTypes.h should use "uintptr_t" instead of "void*" #98
Comments
As this value is not a proper pointer, arbitrary values can be saved in there. It still must be big enough to hold pointers, as per underlying pointer type in ImGui.
Thank you for raising this. I'm still trying to reproduce the warning on my side, can you confirm in parallel that this fixes your issue? |
This fixes the immediate issue I was having. However, a similar error remains. Building
|
OK, thank you for the reproduction steps. I'll have a look. |
|
Welp, now we're at the next library :) Since that is used via the examples, this issue here can be closed, and the new problem can be tracked via inkyblackness/imgui-go-examples#3 . Thank you all for raising this - it helps making APIs cleaner. |
Yup. I thought so too but I don't enough about this end of the language to be helpful. I see someone has raised the issue in go-gl already. |
In case anyone is still watching this, |
Excellent |
In Go 1.14, the Go compiler added a "checkptr" feature that detects misuse of unsafe.Pointer. It's triggering within imgui-go because of conversions like here:
imgui-go/TextureID.go
Line 24 in d81fabb
The problem is
IggTextureID
is declared in imguiWrapperTypes.h astypedef void *IggTextureID
. This makes cgo useunsafe.Pointer
when representing this type in Go.If you instead
#include <stdint.h>
and usetypedef uintptr_t IggTextureID
, the error should go away.The text was updated successfully, but these errors were encountered: