-
Notifications
You must be signed in to change notification settings - Fork 108
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
compiling glad clang and pedantic causes warning on windows #209
Comments
@oddhack can you look at this? see if we need a change. This is under this :
We don't have a #include here. |
@mhhany2000 we need a #if to detect when these types are not included, and #include the correct header.h file, or, if these are not defined, then we need to default to standard C types "int" and such instead. If you can help provide a recommended change, that will help, since we don't have the specific setup you are trying to address. |
@stonesthrow well the problem isn't that they aren't included or defined but that they aren't standard so maybe there should be an option to force the standard types or something? also I don't believe there is anything special about my setup, so I assume this would happen to any other project that includes the |
I don't have any ability to do Windows development. As far as "why", the header is approaching 20 years old and the compiler and language ecosystem has evolved somewhat, in addition to various vendors contributing bits to this header specific to their platform (e.g. whatever SCITECH_SNAP is which frankly I've forgotten). A difficult to answer question is whether anything will break for someone building on an old platform when changes are made, which is why we're very cautious in updating stuff like this - fix one person's issue and you can easily create a new one for someone else. What @mhhany2000 is suggesting with conditionally using the standard types is plausible. |
little update, I tested this on msys2 with a version of clang installed through this package it seems that with this compiler, the macro now I wonder why msvc-clang doesn't define |
There is the generic fallback at the end of #if, #else |
Can you give us the description of "-pedantic-errors" option? |
when compiling glad with clang using the flag
-pedantic
I get these warnings:these warnings do not happen on linux.
this seems to be the piece of code where the warning is generated:
EGL-Registry/api/KHR/khrplatform.h
Lines 186 to 194 in 29c4314
which is only used if _WIN32 is defined, it uses __intN types that are not standard, causing warnings.
How to reproduce:
src
andinclude
directories to the root of your projectmain.cpp
in the root of the projectmain.cpp
clang++ .\src\glad.c .\main.cpp -I .\include\ -pedantic
this will cause the warnings mentioned above.
more info:
OS: Windows 11
clang was installed through visual studio installer (C++ Clang Compiler for Windows)
clang --version output:
note sure any of this information is important to the issue but I included them just in case
The text was updated successfully, but these errors were encountered: