Fix clang compiler warning

[why]
Compiling with clang issues this warning (clang 10.0 and 15.0 tested):

    .../sol/sol.hpp:14541: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.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-11-04 18:47:13 +01:00 committed by The Phantom Derpstorm
parent 0386513a2d
commit c4e843b6dd
2 changed files with 4 additions and 0 deletions

View File

@ -101,7 +101,9 @@ namespace sol {
#if SOL_IS_ON(SOL_COMPILER_GCC)
#pragma GCC diagnostic push
#if !SOL_IS_ON(SOL_COMPILER_CLANG)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#endif
template <typename T>

View File

@ -32,7 +32,9 @@ namespace sol { namespace stack {
#if SOL_IS_ON(SOL_COMPILER_GCC)
#pragma GCC diagnostic push
#if !SOL_IS_ON(SOL_COMPILER_CLANG)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#endif
namespace stack_detail {