diff --git a/backends/imgui_impl_opengl2.cpp b/backends/imgui_impl_opengl2.cpp index eb26307ec..e833cf38d 100644 --- a/backends/imgui_impl_opengl2.cpp +++ b/backends/imgui_impl_opengl2.cpp @@ -44,6 +44,13 @@ #include // intptr_t #endif +// Clang/GCC warnings with -Weverything +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-macros" // warning: macro is not used +#pragma clang diagnostic ignored "-Wnonportable-system-include-path" +#endif + // Include OpenGL header (without an OpenGL loader) requires a bit of fiddling #if defined(_WIN32) && !defined(APIENTRY) #define APIENTRY __stdcall // It is customary to use APIENTRY for OpenGL function pointer declarations on all platforms. Additionally, the Windows OpenGL header needs APIENTRY. @@ -285,3 +292,7 @@ void ImGui_ImplOpenGL2_DestroyDeviceObjects() { ImGui_ImplOpenGL2_DestroyFontsTexture(); } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp index 1ddeeeaf7..7bf26e666 100644 --- a/backends/imgui_impl_opengl3.cpp +++ b/backends/imgui_impl_opengl3.cpp @@ -107,17 +107,20 @@ #include #endif -// Clang warnings with -Weverything +// Clang/GCC warnings with -Weverything #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast #pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness +#pragma clang diagnostic ignored "-Wunused-macros" // warning: macro is not used +#pragma clang diagnostic ignored "-Wnonportable-system-include-path" +#pragma clang diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types (for loader) #endif #if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' -#pragma GCC diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types +#pragma GCC diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types (for loader) #endif // GL includes diff --git a/backends/imgui_impl_sdl2.cpp b/backends/imgui_impl_sdl2.cpp index 86be801cb..478c283d5 100644 --- a/backends/imgui_impl_sdl2.cpp +++ b/backends/imgui_impl_sdl2.cpp @@ -72,6 +72,12 @@ #include "imgui.h" #include "imgui_impl_sdl2.h" +// Clang warnings with -Weverything +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision +#endif + // SDL #include #include @@ -632,3 +638,7 @@ void ImGui_ImplSDL2_NewFrame() // Update game controllers (if enabled and available) ImGui_ImplSDL2_UpdateGamepads(); } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp index 9362f7ed2..c9e6e953a 100644 --- a/backends/imgui_impl_sdl3.cpp +++ b/backends/imgui_impl_sdl3.cpp @@ -24,6 +24,12 @@ #include "imgui.h" #include "imgui_impl_sdl3.h" +// Clang warnings with -Weverything +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision +#endif + // SDL #include #include @@ -565,3 +571,8 @@ void ImGui_ImplSDL3_NewFrame() // Update game controllers (if enabled and available) ImGui_ImplSDL3_UpdateGamepads(); } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + diff --git a/backends/imgui_impl_sdlrenderer.cpp b/backends/imgui_impl_sdlrenderer.cpp index b786ebd28..998a53739 100644 --- a/backends/imgui_impl_sdlrenderer.cpp +++ b/backends/imgui_impl_sdlrenderer.cpp @@ -31,6 +31,12 @@ #include // intptr_t #endif +// Clang warnings with -Weverything +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness +#endif + // SDL #include #if !SDL_VERSION_ATLEAST(2,0,17) @@ -248,3 +254,7 @@ void ImGui_ImplSDLRenderer_DestroyDeviceObjects() { ImGui_ImplSDLRenderer_DestroyFontsTexture(); } + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif