ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.12k stars 500 forks source link

Fix clang compiler warning #1418

Closed Finii closed 1 year ago

Finii commented 1 year ago

[why] Compiling with clang issues this warning (clang 10.0 and 15.0 tested) (single header sol v3.3.0 used)

../include/taskolib/sol/sol/sol.hpp:14541:32: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
                               ^
../include/taskolib/sol/sol/sol.hpp:17294:32: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

[how] Check if the compiler does know the warning, before trying to turn the warning off.

Edit: Add sol version

ThePhD commented 1 year ago

Thanks for cleaning this up; the little things are helpful too! Appreciate it a lot.