From 5475d46bc51ce0fa5a15c99d9707d52a072c6414 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 23 Aug 2022 10:31:32 -0700 Subject: [PATCH] Silence GCC's extra warnings GCC warned about ignored attributes that we use for clang and MSVC. Removing the ignored attributes check keeps this quiet --- CMakeLists.txt | 5 +++++ include/lib_tree_model_adapter.h | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99aad862dd..7bfcb819a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,6 +368,11 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstandalone-debug" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstandalone-debug" ) endif() + + # Suppress GCC warnings about unknown/unused attributes (e.g. cdecl, [[maybe_unused, etc) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes" ) + endif() if( KICAD_SANITIZE_ADDRESS ) add_definitions( -DKICAD_SANITIZE_ADDRESS ) diff --git a/include/lib_tree_model_adapter.h b/include/lib_tree_model_adapter.h index d219599d72..f436b00010 100644 --- a/include/lib_tree_model_adapter.h +++ b/include/lib_tree_model_adapter.h @@ -393,12 +393,7 @@ protected: LIB_TREE_NODE_ROOT m_tree; private: - #ifndef __clang__ - // [[maybe_unused]] attribute is ignored by Gcc but generates a warning. - EDA_BASE_FRAME* m_parent; - #else [[maybe_unused]] EDA_BASE_FRAME* m_parent; - #endif SYM_FILTER_TYPE m_filter; bool m_show_units;