From 4e3e32a391a3187bd15dc30f0c8d1fd3d1bc48dd Mon Sep 17 00:00:00 2001 From: zrj Date: Mon, 22 Jan 2018 09:46:00 +0200 Subject: [PATCH] gcc50: Deal with -Wnarrowing when compiled by gcc80. Cherry-pick to 5.2 --- gnu/usr.bin/cc50/libbackend/Makefile | 5 +++++ gnu/usr.bin/cc50/support-libs/libcommon-target/Makefile | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gnu/usr.bin/cc50/libbackend/Makefile b/gnu/usr.bin/cc50/libbackend/Makefile index 5d545238e2..66119511f1 100644 --- a/gnu/usr.bin/cc50/libbackend/Makefile +++ b/gnu/usr.bin/cc50/libbackend/Makefile @@ -373,6 +373,11 @@ BACKEND_OBJS= \ OBJS= ${BACKEND_OBJS} SRCS= wide-int.cc wide-int-print.cc +# XXX workaround g++80 -Wnarrowing +.if ${CCVER:Mgcc80} +CFLAGS+= -Wno-narrowing +.endif + # hack to force c++ compiler to compile *.c files to create library .for cfile in ${BACKEND_OBJS} ${cfile}: ${cfile:.o=.c} diff --git a/gnu/usr.bin/cc50/support-libs/libcommon-target/Makefile b/gnu/usr.bin/cc50/support-libs/libcommon-target/Makefile index e99e92320e..ecff00531e 100644 --- a/gnu/usr.bin/cc50/support-libs/libcommon-target/Makefile +++ b/gnu/usr.bin/cc50/support-libs/libcommon-target/Makefile @@ -16,6 +16,12 @@ common_out_object_file= i386-common.o OBJS= ${OBJS-libcommon-target} CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}/usr\" +# XXX workaround g++80 -Wnarrowing +# error: narrowing conversion of '-1' from 'int' to 'unsigned int' inside { } +.if ${CCVER:Mgcc80} +CFLAGS+= -Wno-narrowing +.endif + .for ofile in ${OBJS-libcommon-target} ${ofile}: ${ofile:.o=.c} ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} -- 2.11.4.GIT