From 8e00f8029e9695ce2391afbc3656abc8f4994364 Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Thu, 28 Sep 2023 09:24:32 -0700 Subject: [PATCH] Disable `-Wmaybe-uninitialized` in GCC versions 12 and later. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109561 PiperOrigin-RevId: 569204628 Change-Id: I34ccb84a0afc60ccfcc47c820438d15dfa0a5f42 --- python/mujoco/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/mujoco/CMakeLists.txt b/python/mujoco/CMakeLists.txt index ce2984c7..4c125be4 100644 --- a/python/mujoco/CMakeLists.txt +++ b/python/mujoco/CMakeLists.txt @@ -311,6 +311,11 @@ macro(mujoco_pybind11_module name) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Only allow fallthrough annotation via __attribute__. target_compile_options(${name} PRIVATE -Wimplicit-fallthrough=5) + + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109561 + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11) + target_compile_options(${name} PRIVATE -Wno-maybe-uninitialized) + endif() endif() endif() set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})