-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Clang warning fixes #94
Conversation
Thanks! |
np! I also noticed that when you build the opengl_example you get this
I wasn't sure how you want to address this so I figured I let you know instead. |
Arghh c++, finding new ways to get in your way. I'll add an offsetof macro. |
It sure does. |
Btw something that may be of interest for you is Travis-CI: http://docs.travis-ci.com/user/languages/cpp/ It will allow you to setup so you can have builds of your project (for non-windows platforms) being compiled and report errors. I haven't tried it myself (as I need Windows support) but might be worth considering and it seems quite simple to setup. |
I still get warnings, even with the OFFSETOF () macro ;)
On Centos 6 btw. |
They are harmless, but it'd be interesting to know how your compiler librairies implement the (lowercase) offsetof() macro themselves.
|
No idea :) pretty new to Linux & gcc. |
Hi :) If the clang, if we use the sanitizer for undefined behaviors, the IM_OFFSETOF macro raises some errors at run-time. A workaround could be to do this: #if defined(__clang__)
# define IM_OFFSETOF(_TYPE, _MEMBER) offsetof(_TYPE, _MEMBER)
#else
# define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER))
#endif Would you be OK with something like that ? |
Hello, could you specify what are the warnings and in which version of Clang?
Thank you.
|
yes sure, the I had the issue on both clang 6 and clang 8.0.1. To reproduce:
@@ 12
-#CXX = clang++
+CXX = clang++
@@ 21
-CXXFLAGS = -I../ -I../../
+CXXFLAGS = -I../ -I../../ -fsanitize=undefined -fsanitize-recover=all
@@ 30
-SOURCES += ../libs/gl3w/GL/gl3w.c
-CXXFLAGS += -I../libs/gl3w
+#SOURCES += ../libs/gl3w/GL/gl3w.c
+#CXXFLAGS += -I../libs/gl3w
-# CXXFLAGS = -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW
+CXXFLAGS += -lGLEW -DIMGUI_IMPL_OPENGL_LOADER_GLEW
|
…laining about old-style macros. (#94)
Thank you @Keenuts. My next question was to find out in which version of Clang this appeared, but it seems to be a C++11 thing so I am now using |
Oh cool, thanks! |
No description provided.