I'm using GLAD on my project, and building everything with cmake.
Since this is an external library and not my code, I'd like to completely suppress its warnings during build time, because I get a ton of these:
warning: ISO C forbids conversion of object pointer to function pointer type [-Wpedantic]
glad_glCullFace = ( PFNGLCULLFACEPROC ) load ( "glCullFace" );
^
How can I do it? I can either just include it in my sources, or do an add_library with GLAD's sources, don't mind either way.
Thanks
Use -Wno-dev to suppress it. You can disable the warning like this when you are configuring your build.
To suppress this warning use the unused attribute (see Variable Attributes). This warning is also enabled by -Wunused , which is enabled by -Wall . Warn whenever a static function is declared but not defined or a non-inline static function is unused.
Use the SYSTEM keyword to avoid warnings from system libraries like so:
target_include_directories(target SYSTEM GLAD)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With