blob: e87dc9f76bf7c673de9ba918ce172e39e412e796 [file] [log] [blame]
Andrew Geissler748a4832020-07-24 16:24:21 -05001From c5b2c6327f3692ed07bf8d212123e0bf08485722 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
Patrick Williamsc0f7c042017-02-23 20:41:17 -06006clang 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
Andrew Geissler748a4832020-07-24 16:24:21 -050026---
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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034@@ -56,7 +56,7 @@ ifndef WARNING_CFLAGS
Patrick Williamsc0f7c042017-02-23 20:41:17 -060035 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