Handle errors if WARNS is not defined.

One conditional outside of ifdef WARNS did not protect against an
unset WARNS. Default WARNS to 0 in conditional if not defined.

Obtained from:	Juniper Networks, Inc.
This commit is contained in:
Steve Kiernan 2023-01-16 15:41:20 -08:00 committed by Stephen J. Kiernan
parent a12d60b99e
commit 4e8b87afe0

View file

@ -149,7 +149,7 @@ WFORMAT= 1
.if ${WFORMAT} > 0
#CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args
.if ${WARNS} <= 3
.if ${WARNS:U0} <= 3
CWARNFLAGS.clang+= -Wno-format-nonliteral
.endif # WARNS <= 3
.if ${MK_WERROR} != "no" && ${MK_WERROR.${COMPILER_TYPE}:Uyes} != "no"