]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Compile with -Wformat-signedness if possible.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 23 Nov 2016 22:17:10 +0000 (23:17 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 4 Dec 2016 10:14:27 +0000 (11:14 +0100)
We can't activate this warning unconditionally because it is not
supported on older compilers, including clang. Therefore we introduce
a build time check and add the option only if the compiler supports it.

Makefile.real

index ce4881d29c90c8626e44d384dab14c81e15b11b8..464cd68ee2a1af044d0b09e36f4681db2a836aae 100644 (file)
@@ -128,6 +128,13 @@ ifeq ($(uname_s),Linux)
        LDFLAGS += -Wl,--gc-sections
 endif
 
+cc-option = $(shell \
+       $(CC) $(1) -Werror -c -x c /dev/null -o /dev/null > /dev/null 2>&1 \
+       && echo "$(1)" \
+)
+
+STRICT_CFLAGS += $(call cc-option, -Wformat-signedness)
+
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
 ifeq ("$(origin V)", "command line")