ignore build warnings #2 55/222055/4 accepted/tizen/unified/20200114.130747 submit/tizen/20200113.012656
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 9 Jan 2020 09:00:06 +0000 (18:00 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 10 Jan 2020 02:25:04 +0000 (11:25 +0900)
Change-Id: Ice0acf1c5a04ebe333d153d21aaebcb1f22bdcf9

Makefile

index cdd12ca..f92c120 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,18 +27,22 @@ ADDLIB+=dnet_ntop.o dnet_pton.o
 ADDLIB+=ipx_ntop.o ipx_pton.o
 
 CC = gcc
+GCCVERSION = $(shell gcc -dumpversion | cut -f1 -d.)
 HOSTCC = gcc
 DEFINES += -D_GNU_SOURCE
 CCOPTS = -O2
 WFLAGS := -g -Wall -Wstrict-prototypes -Werror -Wmissing-prototypes
 WFLAGS += -Wmissing-declarations -Wold-style-definition
+# Add exception option for gcc-9
+WFLAGS += -Wno-stringop-truncation -Wno-stringop-overflow -Wno-format-truncation
+ifeq "$(GCCVERSION)" "9"
+WFLAGS += -Wno-error=memset-elt-size
+endif
 
 CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
 YACCFLAGS = -d -t -v
 
 CFLAGS += -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE -pie
-# Add exception option for gcc-9
-CFLAGS += -Wno-stringop-truncation -Wno-stringop-overflow -Wno-format-truncation
 LDFLAGS += -pie -Wl,-z,relro,-z,now
 
 SUBDIRS=lib ip tc bridge misc netem genl man