From 45703321ea8d03c874b4dd3be6569acc494404f2 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Sat, 19 May 2001 23:32:19 +0000 Subject: [PATCH] Only add -Werror if in fact we have set WARNS or WFORMAT to >0 --- share/mk/bsd.sys.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index efb69a9c97b4..566917c4b976 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -13,6 +13,9 @@ CFLAGS += -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith # XXX Delete -Wuninitialized by default for now -- the compiler doesn't # XXX always get it right. CFLAGS += -Wno-uninitialized +. if !defined(NO_WERROR) +CFLAGS += -Werror +. endif . endif . if ${WARNS} > 1 CFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow @@ -25,11 +28,10 @@ WFORMAT = 1 . if defined(WFORMAT) . if ${WFORMAT} > 0 CFLAGS += -Wnon-const-format -Wno-format-extra-args -. endif -. endif - -. if !defined(NO_WERROR) +. if !defined(NO_WERROR) CFLAGS += -Werror +. endif +. endif . endif .endif