From 8ca960fa0274018cb4f94a1826029d74e6f762e0 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 21 Jun 2021 20:24:03 +0200 Subject: lib, ipcpd, irmd: Wrap pthread unlocks for cleanup This add an ouroboros/pthread.h header that wraps the pthread_..._unlock() functions for cleanup using pthread_cleanup_push() as this casting is not safe (and there were definitely bad casts in the code). The close() function is now also wrapped for cleanup in ouroboros/sockets.h. This allows enabling more compiler checks. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index dd26c828..e0c7bef3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,8 @@ include(CompilerUtils) test_and_set_c_compiler_flag_global(-std=c89) test_and_set_c_compiler_flag_global(-Wall) # -Wextra may fail on clobbered warning due to pthread_cleanup -# test_and_set_c_compiler_flag_global(-Wextra) +test_and_set_c_compiler_flag_global(-Wno-clobbered) +test_and_set_c_compiler_flag_global(-Wextra) # explicitly add other flags in -Wextra test_and_set_c_compiler_flag_global(-Wempty-body) test_and_set_c_compiler_flag_global(-Wignored-qualifiers) @@ -75,14 +76,13 @@ test_and_set_c_compiler_flag_global(-Wuninitialized) test_and_set_c_compiler_flag_global(-Wshift-negative-value) test_and_set_c_compiler_flag_global(-Wunused-parameter) test_and_set_c_compiler_flag_global(-Wunused-but-set-parameter) -# -Wextra parameters test_and_set_c_compiler_flag_global(-Werror) test_and_set_c_compiler_flag_global(-Wundef) test_and_set_c_compiler_flag_global(-Wpointer-arith) test_and_set_c_compiler_flag_global(-Wstrict-prototypes) test_and_set_c_compiler_flag_global(-Wvla) -#Wswitch-default check fails on the swig-generated code -#test_and_set_c_compiler_flag_global(-Wswitch-default) +test_and_set_c_compiler_flag_global(-Wswitch-default) +test_and_set_c_compiler_flag_global(-Wreturn-type) test_and_set_c_compiler_flag_global(-Wunreachable-code) test_and_set_c_compiler_flag_global(-Wdeclaration-after-statement) test_and_set_c_compiler_flag_global(-Winfinite-recursion) -- cgit v1.2.3