From 4995ec0ba6f15e03deb4b9ad1dc215f3f8993acb Mon Sep 17 00:00:00 2001 From: Luis Fernandez Date: Thu, 21 Feb 2019 14:13:44 -0600 Subject: HB Improvements: Fix compiler warnings on modern compilers Resolve warnings when compiling with gcc 4.8. Compiled with GCC 7.3, no more compile errors/warnings; build ends with caught exception from linker. This commit compiles with GCC 8.2, no more error/warnings; except for a linking warning. Change-Id: Ib5d7c2b5bd350edc76ee2c7de96896154cd44420 RTC: 202716 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72271 Reviewed-by: Nicholas E. Bofferding Reviewed-by: Ilya Smirnov Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/build/mkrules/cflags.env.mk | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/build/mkrules/cflags.env.mk') diff --git a/src/build/mkrules/cflags.env.mk b/src/build/mkrules/cflags.env.mk index 732e6559e..04ff6fedd 100644 --- a/src/build/mkrules/cflags.env.mk +++ b/src/build/mkrules/cflags.env.mk @@ -38,22 +38,14 @@ CFLAGS += -DNO_INITIALIZER_LIST CFLAGS += -D__FAPI endif -try = $(shell set -e; if ($(1)) >/dev/null 2>&1; \ - then echo "$(2)"; \ - else echo "$(3)"; fi ) - -try-cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,$(2)) -test_cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,1,0) COMMONFLAGS += $(OPT_LEVEL) -nostdlib CFLAGS += $(COMMONFLAGS) -mcpu=power7 -nostdinc -g -mno-vsx -mno-altivec\ - -Wall -mtraceback=no -pipe -mabi=elfv1 \ - $(call try-cflag,$(CC),-Wno-error=sizeof-array-argument) \ - $(call try-cflag,$(CC),-Wno-error=unused-function) \ + -Werror -Wall -mtraceback=no -pipe -mabi=elfv1 \ -ffunction-sections -fdata-sections -ffreestanding -mbig-endian ASMFLAGS += $(COMMONFLAGS) -mcpu=power7 -mbig-endian -ffreestanding -mabi=elfv1 -CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Wall \ - -fuse-cxa-atexit -std=gnu++14 -fpermissive +CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Werror -Wall \ + -fuse-cxa-atexit -std=gnu++14 LDFLAGS += --nostdlib --sort-common -EB $(COMMONFLAGS) INCFLAGS = $(addprefix -I, $(INCDIR) ) -- cgit v1.2.1