From 82f0488f77219fae4ff8fe5fa28d8e4238dc1452 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 10 Sep 2021 19:30:17 +0200 Subject: [PATCH] argtable: move GCC-specific pragma to cmake/make files ...and only add it when building with GCC. --- components/console/CMakeLists.txt | 4 ++++ components/console/argtable3/argtable3.c | 2 -- components/console/component.mk | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/console/CMakeLists.txt b/components/console/CMakeLists.txt index 6fddca7f61..cde2b05cd2 100644 --- a/components/console/CMakeLists.txt +++ b/components/console/CMakeLists.txt @@ -6,3 +6,7 @@ idf_component_register(SRCS "commands.c" INCLUDE_DIRS "." REQUIRES vfs PRIV_REQUIRES driver) + +if(CMAKE_C_COMPILER_ID MATCHES "GNU") + set_source_files_properties(argtable3/argtable3.c PROPERTIES COMPILE_FLAGS -Wno-clobbered) +endif() diff --git a/components/console/argtable3/argtable3.c b/components/console/argtable3/argtable3.c index ca9149277c..0c3cb729fd 100644 --- a/components/console/argtable3/argtable3.c +++ b/components/console/argtable3/argtable3.c @@ -30,8 +30,6 @@ #include "argtable3.h" -#pragma GCC diagnostic ignored "-Wclobbered" - /******************************************************************************* * This file is part of the argtable3 library. * diff --git a/components/console/component.mk b/components/console/component.mk index 0a6d4945e3..703e86d80d 100644 --- a/components/console/component.mk +++ b/components/console/component.mk @@ -1,2 +1,4 @@ COMPONENT_ADD_INCLUDEDIRS := . COMPONENT_SRCDIRS := linenoise argtable3 . + +argtable3/argtable3.o: CFLAGS += -Wno-clobbered