Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 1 | From c5b2c6327f3692ed07bf8d212123e0bf08485722 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 7 Mar 2020 08:34:02 -0800 |
| 4 | Subject: [PATCH] nss,nspr: Add recipes |
| 5 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 6 | clang 3.9 add this warning to rightly flag undefined |
| 7 | behavior, we relegate this to be just a warning instead |
| 8 | of error and keep the behavior as it was. Right fix would |
| 9 | be to not pass enum to the function with variadic arguments |
| 10 | as last named argument |
| 11 | |
| 12 | Fixes errors like |
| 13 | ocsp.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 | ^ |
| 16 | ocsp.c:2200:43: note: parameter of type 'SECOidTag' is declared here |
| 17 | SECOidTag responseType0, ...) |
| 18 | |
| 19 | see |
| 20 | https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start |
| 21 | for more details |
| 22 | |
| 23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 24 | Upstream-Status: Pending |
| 25 | |
Andrew Geissler | 748a483 | 2020-07-24 16:24:21 -0500 | [diff] [blame] | 26 | --- |
| 27 | nss/coreconf/Werror.mk | 2 +- |
| 28 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 29 | |
| 30 | diff --git a/nss/coreconf/Werror.mk b/nss/coreconf/Werror.mk |
| 31 | index a569a49..687fe58 100644 |
| 32 | --- a/nss/coreconf/Werror.mk |
| 33 | +++ b/nss/coreconf/Werror.mk |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 34 | @@ -56,7 +56,7 @@ ifndef WARNING_CFLAGS |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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 |