summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlois Klink <alois@aloisklink.com>2022-12-13 13:06:34 +0000
committerAndreas Schneider <asn@cryptomilk.org>2024-02-03 14:01:22 +0100
commitfb38de9dd4a020b3ed128a018c5998c06aa27d1d (patch)
tree42cfa9df64f420b1849cc4e4f4448ea3c0edd22f
parenta74d9cd2ede76a3e815785dad1f0406f275da83c (diff)
downloadcmocka-fb38de9dd4a020b3ed128a018c5998c06aa27d1d.zip
cmocka-fb38de9dd4a020b3ed128a018c5998c06aa27d1d.tar.gz
cmocka-fb38de9dd4a020b3ed128a018c5998c06aa27d1d.tar.bz2
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 <info@nqminds.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit bfdf78c4e6f870977ff8996abecd84ba7086a331)
-rw-r--r--CompilerChecks.cmake2
1 files changed, 0 insertions, 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)