summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-11-19 11:55:43 -0500
committerAllen Winter <allen.winter@kdab.com>2022-11-19 11:55:43 -0500
commit32068f1e1b1eec1f6ca1fe6e6f21a7c5a2c04b16 (patch)
tree10fda06f9f667f410100e418d13eb908579839c3
parentca294b8305196e5c857ed34a797e6ba47e338acc (diff)
downloadlibical-git-32068f1e1b1eec1f6ca1fe6e6f21a7c5a2c04b16.tar.gz
Add gcc/clang options -Wold-style-definition -Wstrict-prototypes
to better enforce modern C
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5c411f4..7bf0987b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -513,6 +513,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
check_c_compiler_flag(-Wunreachable-code HAVE_GCC_UNREACHABLE_CODE)
check_c_compiler_flag(-Wvarargs HAVE_GCC_VARARGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wno-deprecated -Wall -Wno-unknown-pragmas -Wextra -Winit-self -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wtype-limits -Wwrite-strings -Werror=return-type")
+ #for more modern C
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wold-style-definition -Wstrict-prototypes")
if(HAVE_GCC_UNUSED_BUT_SET)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-but-set-variable")
endif()