[PATCH 2/2] multipath-tools: check for C compiler option -Werror=discarded-qualifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The -Werror=discarded-qualifiers option is not supported on GCC 4.8
(ships in Ubuntu 14.04 at least). Use TEST_CC_OPTION to detect that
and fix a build failure.

No regression on Ubuntu 18.04 (GCC 7.3, -Werror=discarded-qualifiers
used).

Fixes: ff307801
"multipath-tools: Makefile.inc: use -Werror=cast-qual"

Signed-off-by: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
---
 Makefile.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index a12b46ef315e..a83f02c72ed6 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -86,11 +86,12 @@ TEST_CC_OPTION = $(shell \
 	fi)
 
 STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)
+ERROR_DISCARDED_QUALIFIERS := $(call TEST_CC_OPTION,-Werror=discarded-qualifiers,)
 
 OPTFLAGS	= -O2 -g -pipe -Wall -Wextra -Wformat=2 -Werror=implicit-int \
 		  -Werror=implicit-function-declaration -Werror=format-security \
 		  -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \
-		  -Werror=cast-qual -Werror=discarded-qualifiers \
+		  -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) \
 		  -Wp,-D_FORTIFY_SOURCE=2 $(STACKPROT) \
 		  --param=ssp-buffer-size=4
 
-- 
2.17.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux