From e74f372330549bf4cbd8f4d880aceb87d7516005 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 23:57:48 +0300 Subject: [PATCH] Get back -Wsigned-one-bit-field and fix sources according to it Signed-off-by: makise-homura --- CMakeLists.txt | 4 ---- tests/include/test/macros.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2cf44629..88332464b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,10 +175,6 @@ if(CMAKE_COMPILER_IS_GNU) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-signedness") endif() endif() - CHECK_C_COMPILER_FLAG("-Wno-signed-one-bit-field" C_COMPILER_SUPPORTS_WSIGNED_ONE_BIT_FIELD) - if(C_COMPILER_SUPPORTS_WSIGNED_ONE_BIT_FIELD) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-signed-one-bit-field") - endif() set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") diff --git a/tests/include/test/macros.h b/tests/include/test/macros.h index aaf13add0..21552e760 100644 --- a/tests/include/test/macros.h +++ b/tests/include/test/macros.h @@ -75,7 +75,7 @@ /* A compile-time constant with the value 0. If `const_expr` is not a * compile-time constant with a nonzero value, cause a compile-time error. */ #define STATIC_ASSERT_EXPR( const_expr ) \ - ( 0 && sizeof( struct { int STATIC_ASSERT : 1 - 2 * ! ( const_expr ); } ) ) + ( 0 && sizeof( struct { unsigned int STATIC_ASSERT : 1 - 2 * ! ( const_expr ); } ) ) /* Return the scalar value `value` (possibly promoted). This is a compile-time * constant if `value` is. `condition` must be a compile-time constant. * If `condition` is false, arrange to cause a compile-time error. */