summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Štetiar2023-03-29 07:29:54 +0000
committerPetr Štetiar2023-05-31 16:42:59 +0000
commit9d68f398635cc18b83c5b30927e916532bbe535d (patch)
tree4f8a159cff060074b513cc4486cae5b30d5c6470
parent1fe1d4f5e8c2e235a1ab4e0df8baa734142fe994 (diff)
downloadnetifd-9d68f398635cc18b83c5b30927e916532bbe535d.tar.gz
cmake: fix build by reordering the cflags definitions
I've noticed bunch of build errors being emitted by clang-15/gcc-10: netifd.h:83:33: error: unused parameter 'level' [-Werror,-Wunused-parameter] and it seems, that the order of definitions matters as -Wextra probably enables previously disabled warnings like -Wno-unused-parameter. So lets fix it, by reordering the cflags definitions. Fixes: 463a1207f076 ("netifd: Activate -Wextra compile warnings") Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b87c300..5ad8695 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,11 +7,12 @@ IF(NOT ${CMAKE_VERSION} LESS 3.0)
check_c_compiler_flag(-Wimplicit-fallthrough HAS_IMPLICIT_FALLTHROUGH)
ENDIF()
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter)
+ADD_DEFINITIONS(-Wall -Werror)
IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
add_definitions(-Wextra -Werror=implicit-function-declaration)
add_definitions(-Wformat -Werror=format-security -Werror=format-nonliteral)
ENDIF()
+ADD_DEFINITIONS(-Os --std=gnu99 -Wmissing-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter)
IF(HAS_IMPLICIT_FALLTHROUGH)
ADD_DEFINITIONS(-Wimplicit-fallthrough)