Commit Graph

13 Commits

Author SHA1 Message Date
Andreas Schneider 4e8a7cd581 cmake: Add more compiler warnings
See https://fedoraproject.org/wiki/Changes/PortingToModernC
2023-02-01 08:38:44 +01:00
Andreas Schneider 2df2d3a3ce cmake: Use C99 and define GNU and POSIX flags directly at source files
Fixes #50
2023-02-01 08:38:44 +01:00
Alois Klink bfdf78c4e6 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 5a4b15870e, so this
behaviour is valid on all compilers.

on-behalf-of: @nqminds <info@nqminds.com>

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-01-29 10:35:41 +01:00
Evan Miller 8820579699 Always pass stack-protector flag to linker
Fixes issue with GCC 7.5 and OS X 10.4.

See: https://trac.macports.org/ticket/63469

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-03-11 08:09:08 +01:00
Andreas Schneider bd0667c6d9 cmake: Add -Wmissing-field-initializers
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-16 17:01:14 +01:00
Andreas Schneider 1348a109ac cmake: Only check for -Wno-gnu-zero-variadic-macro-arguments with clang
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-02 14:47:33 +02:00
Andreas Schneider d1a7ebd1b9 cmake: Remove -Wno-deprecated-declarations on OSX 2018-09-19 12:06:14 +02:00
Andreas Schneider 7b8d5c42e2 cmake: Fix linking with -fstack-protector* on Solaris
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-11 16:52:02 +02:00
Andreas Schneider 68c0a6ce3d cmake: Use -Wpedantic and remove -pedantic-errors
We get -Werror if -DPICKY_DEVELOPER=ON is set.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-06 08:03:39 +02:00
Andreas Schneider 29ab727f32 cmake: Add compiler check for -fstack-clash-protection 2018-09-03 15:45:38 +02:00
Andreas Schneider 5ccaafb31c cmake: Add compiler check for -fstack-protector-strong 2018-09-02 10:50:21 +02:00
Andreas Schneider eb418c201d cmake: Improve compiler checks
Always use -Werror to detect compiler flags if possible.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-24 12:05:14 +02:00
Andreas Schneider c49a7bc032 cmake: Add new CompilerCheck.cmake 2018-08-22 13:02:28 +02:00