build: Compile with -Wdiscarded-qualifiers.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 3 Jan 2018 17:50:15 +0000 (18:50 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 13 Mar 2018 02:28:10 +0000 (03:28 +0100)
This option is unsupported (but warnings are invariably enabled) for
old gcc versions including 4.2.2. It is supported but not enabled by
default for vanilla gcc-5.5.0, but is enabled for the gcc versions
which ship with Ubuntu-14.04 (4.8.4) and Ubuntu-16.04 (5.4.0).

This patch enables the warning everywhere. We have to employ the
cc-option macro to determine whether the option is supported.

Makefile.real

index 7648767732470d0bc0e10adb2a69e981f709fceb..dae48f0e7f85f43984c2be17cdb26d4b8945032d 100644 (file)
@@ -144,6 +144,7 @@ cc-option = $(shell \
 )
 
 STRICT_CFLAGS += $(call cc-option, -Wformat-signedness)
+STRICT_CFLAGS += $(call cc-option, -Wdiscarded-qualifiers)
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands