From fb38de9dd4a020b3ed128a018c5998c06aa27d1d Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Tue, 13 Dec 2022 13:06:34 +0000 Subject: cmake: disable `-Wdeclaration-after-statement` Disable `-Wdeclaration-after-statement`. Before ISO C99, declaring variables after statements was not allowed by the C standard, but was allowed by GCC as an extension. CMocka now requires a minimum version of C99, since commit 5a4b15870efa2225e6586fbb4c3af05ff0659434, so this behaviour is valid on all compilers. on-behalf-of: @nqminds Reviewed-by: Andreas Schneider (cherry picked from commit bfdf78c4e6f870977ff8996abecd84ba7086a331) --- CompilerChecks.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake index b326807..e39cc1d 100644 --- a/CompilerChecks.cmake +++ b/CompilerChecks.cmake @@ -31,8 +31,6 @@ if (UNIX) add_c_compiler_flag("-Werror-implicit-function-declaration" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wpointer-arith" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Werror=pointer-arith" SUPPORTED_COMPILER_FLAGS) - add_c_compiler_flag("-Wdeclaration-after-statement" SUPPORTED_COMPILER_FLAGS) - add_c_compiler_flag("-Werror=declaration-after-statement" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wreturn-type" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Werror=return-type" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wuninitialized" SUPPORTED_COMPILER_FLAGS) -- cgit v1.1