From: Andre Noll Date: Wed, 23 Nov 2016 22:17:10 +0000 (+0100) Subject: Compile with -Wformat-signedness if possible. X-Git-Tag: v0.5.7~6^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6be2a7de19d8fe01f67207d8412fba7b468c6b11 Compile with -Wformat-signedness if possible. 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. --- diff --git a/Makefile.real b/Makefile.real index ce4881d2..464cd68e 100644 --- a/Makefile.real +++ b/Makefile.real @@ -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")