1From f613c9a9107435a40d91329f33f12cfb16927f07 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Sat, 7 Mar 2020 08:34:02 -0800 4Subject: [PATCH] nss,nspr: Add recipes 5 6clang 3.9 add this warning to rightly flag undefined 7behavior, we relegate this to be just a warning instead 8of error and keep the behavior as it was. Right fix would 9be to not pass enum to the function with variadic arguments 10as last named argument 11 12Fixes errors like 13ocsp.c:2220:22: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] 14 va_start(ap, responseType0); 15 ^ 16ocsp.c:2200:43: note: parameter of type 'SECOidTag' is declared here 17 SECOidTag responseType0, ...) 18 19see 20https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start 21for more details 22 23Signed-off-by: Khem Raj <raj.khem@gmail.com> 24Upstream-Status: Pending 25 26--- 27 nss/coreconf/Werror.mk | 2 +- 28 1 file changed, 1 insertion(+), 1 deletion(-) 29 30diff --git a/nss/coreconf/Werror.mk b/nss/coreconf/Werror.mk 31index a569a49..687fe58 100644 32--- a/nss/coreconf/Werror.mk 33+++ b/nss/coreconf/Werror.mk 34@@ -56,7 +56,7 @@ ifndef WARNING_CFLAGS 35 ifdef CC_IS_CLANG 36 # -Qunused-arguments : clang objects to arguments that it doesn't understand 37 # and fixing this would require rearchitecture 38- WARNING_CFLAGS += -Qunused-arguments 39+ WARNING_CFLAGS += -Qunused-arguments -Wno-error=varargs 40 # -Wno-parentheses-equality : because clang warns about macro expansions 41 WARNING_CFLAGS += $(call disable_warning,parentheses-equality) 42 ifdef BUILD_OPT 43