diff --git a/src/init_from_settings.cpp b/src/init_from_settings.cpp index 053585f..9d8fb19 100644 --- a/src/init_from_settings.cpp +++ b/src/init_from_settings.cpp @@ -15,6 +15,14 @@ #ifndef BOOST_LOG_WITHOUT_SETTINGS_PARSERS +#if defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) \ + && (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 +// This warning is caused by a compiler bug which is exposed when boost::optional is used: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679 +// It has to be disabled here, before any code is included, since otherwise it doesn't help and the warning is still emitted. +// ‘*((void*)& foo +2)’ may be used uninitialized in this function +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #include "windows_version.hpp" #include #include