diff options
Diffstat (limited to 'meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch')
-rw-r--r-- | meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch b/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch new file mode 100644 index 0000000000..86b1b60556 --- /dev/null +++ b/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | clang 3.9 add this warning to rightly flag undefined | ||
2 | behavior, we relegate this to be just a warning instead | ||
3 | of error and keep the behavior as it was. Right fix would | ||
4 | be to not pass enum to the function with variadic arguments | ||
5 | as last named argument | ||
6 | |||
7 | Fixes errors like | ||
8 | ocsp.c:2220:22: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] | ||
9 | va_start(ap, responseType0); | ||
10 | ^ | ||
11 | ocsp.c:2200:43: note: parameter of type 'SECOidTag' is declared here | ||
12 | SECOidTag responseType0, ...) | ||
13 | |||
14 | see | ||
15 | https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start | ||
16 | for more details | ||
17 | |||
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
19 | Upstream-Status: Pending | ||
20 | |||
21 | Index: nss-3.24/nss/coreconf/Werror.mk | ||
22 | =================================================================== | ||
23 | --- nss-3.24.orig/nss/coreconf/Werror.mk | ||
24 | +++ nss-3.24/nss/coreconf/Werror.mk | ||
25 | @@ -54,7 +54,7 @@ ifndef WARNING_CFLAGS | ||
26 | ifdef CC_IS_CLANG | ||
27 | # -Qunused-arguments : clang objects to arguments that it doesn't understand | ||
28 | # and fixing this would require rearchitecture | ||
29 | - WARNING_CFLAGS += -Qunused-arguments | ||
30 | + WARNING_CFLAGS += -Qunused-arguments -Wno-error=varargs | ||
31 | # -Wno-parentheses-equality : because clang warns about macro expansions | ||
32 | WARNING_CFLAGS += $(call disable_warning,parentheses-equality) | ||
33 | ifdef BUILD_OPT | ||