]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3451] Disabled -Wshadow in asio_wrapper.h
authorFrancis Dupont <fdupont@isc.org>
Sat, 18 Oct 2025 12:16:05 +0000 (14:16 +0200)
committerAndrei Pavel <andrei@isc.org>
Sun, 26 Oct 2025 16:58:23 +0000 (18:58 +0200)
src/lib/asiolink/asio_wrapper.h

index a33c56f2d4d1900a5ca23df1b3fe4b6cfcc9a6d0..e037678bc394c952e7ee265e1e13faf63c15f91b 100644 (file)
 // Include it in all situations for simplicity.
 #include <utility>
 
+// Another problem is some boost versions raise a warning with -Wshadow
+// so disable it.
+
 #define GNU_CC_VERSION (__GNUC__ * 10000 \
                      + __GNUC_MINOR__ * 100 \
                      + __GNUC_PATCHLEVEL__)
 
-#if (defined(__GNUC__) && \
-    ((GNU_CC_VERSION >= 50200) && (GNU_CC_VERSION < 60000)) \
-    && defined(BOOST_ERROR_CODE_HEADER_ONLY))
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#if (((GNU_CC_VERSION >= 50200) && (GNU_CC_VERSION < 60000))    \
+     && defined(BOOST_ERROR_CODE_HEADER_ONLY))
 #pragma GCC push_options
 #pragma GCC optimize ("O0")
 #include <boost/asio.hpp>
@@ -78,5 +83,9 @@
 #else
 #include <boost/asio.hpp>
 #endif
+#pragma GCC diagnostic pop
+#else
+#include <boost/asio.hpp>
+#endif
 
 #endif // ASIO_WRAPPER_H