loguru
loguru copied to clipboard
Also suppress clang warnings about unknown warnings
Without this, older versions of clang will for example warn:
loguru.cpp:21:32: warning: unknown warning group '-Wzero-as-null-pointer-constant', ignored [-Wunknown-warning-option] #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" ^
Why do we want to ignore these warnings?
Without this patch, old versions of clang warn on the existing line:
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
Because old versions don't have -Wzero-as-null-pointer-constant so they say "what's this warning you want me to disable?! there is no such warning."
An alternative is to conditionalize the diagnostic ignored statements, for clang you could do like this:
#if __has_warning("-Wreserved-identifier")
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif
But I'm not sure about gcc....