diff options
| author | Khem Raj <raj.khem@gmail.com> | 2020-08-26 17:49:50 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-08-26 19:20:40 -0700 |
| commit | 6e11e4126447e3c03afcc023db565526e3bee607 (patch) | |
| tree | ee8e17f02de6cca09ad0eb92fc2a69a8940d1ae8 | |
| parent | fc995b3cfed86850ce5ab1b70da1e31560ac350f (diff) | |
| download | meta-openembedded-6e11e4126447e3c03afcc023db565526e3bee607.tar.gz | |
nss: Avoid converting enum to void*
Found with clang-11
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/nss/nss/0001-pkix-Do-not-use-NULL-where-0-is-needed.patch | 46 | ||||
| -rw-r--r-- | meta-oe/recipes-support/nss/nss_3.54.bb | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/nss/nss/0001-pkix-Do-not-use-NULL-where-0-is-needed.patch b/meta-oe/recipes-support/nss/nss/0001-pkix-Do-not-use-NULL-where-0-is-needed.patch new file mode 100644 index 0000000000..432312da25 --- /dev/null +++ b/meta-oe/recipes-support/nss/nss/0001-pkix-Do-not-use-NULL-where-0-is-needed.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From 1136cad77c2dc7d8e1daa317877676733e805f29 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 26 Aug 2020 17:30:40 -0700 | ||
| 4 | Subject: [PATCH] pkix: Do not use NULL where 0 is needed | ||
| 5 | |||
| 6 | Clang finds this error | ||
| 7 | |||
| 8 | pkix_logger.c:316:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] | ||
| 9 | logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
| 10 | ^~~~~~~~~~~~~~~~~~~~~ | ||
| 11 | pkix_logger.c:617:32: error: cast to smaller integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast] | ||
| 12 | logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
| 13 | ^~~~~~~~~~~~~~~~~~~~~ | ||
| 14 | 2 errors generated. | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://bugzilla.mozilla.org/show_bug.cgi?id=1661378] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | nss/lib/libpkix/pkix/util/pkix_logger.c | 4 ++-- | ||
| 20 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/nss/lib/libpkix/pkix/util/pkix_logger.c b/nss/lib/libpkix/pkix/util/pkix_logger.c | ||
| 23 | index a916e6e..10f537a 100644 | ||
| 24 | --- a/nss/lib/libpkix/pkix/util/pkix_logger.c | ||
| 25 | +++ b/nss/lib/libpkix/pkix/util/pkix_logger.c | ||
| 26 | @@ -313,7 +313,7 @@ pkix_Logger_Destroy( | ||
| 27 | |||
| 28 | logger->callback = NULL; | ||
| 29 | PKIX_DECREF(logger->context); | ||
| 30 | - logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
| 31 | + logger->logComponent = (PKIX_ERRORCLASS)0; | ||
| 32 | |||
| 33 | cleanup: | ||
| 34 | |||
| 35 | @@ -614,7 +614,7 @@ PKIX_Logger_Create( | ||
| 36 | |||
| 37 | logger->callback = callback; | ||
| 38 | logger->maxLevel = 0; | ||
| 39 | - logger->logComponent = (PKIX_ERRORCLASS)NULL; | ||
| 40 | + logger->logComponent = (PKIX_ERRORCLASS)0; | ||
| 41 | |||
| 42 | PKIX_INCREF(loggerContext); | ||
| 43 | logger->context = loggerContext; | ||
| 44 | -- | ||
| 45 | 2.28.0 | ||
| 46 | |||
diff --git a/meta-oe/recipes-support/nss/nss_3.54.bb b/meta-oe/recipes-support/nss/nss_3.54.bb index dc5cafbf1c..882145c1ef 100644 --- a/meta-oe/recipes-support/nss/nss_3.54.bb +++ b/meta-oe/recipes-support/nss/nss_3.54.bb | |||
| @@ -32,6 +32,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSIO | |||
| 32 | file://system-pkcs11.txt \ | 32 | file://system-pkcs11.txt \ |
| 33 | file://nss-fix-nsinstall-build.patch \ | 33 | file://nss-fix-nsinstall-build.patch \ |
| 34 | file://0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch \ | 34 | file://0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch \ |
| 35 | file://0001-pkix-Do-not-use-NULL-where-0-is-needed.patch \ | ||
| 35 | " | 36 | " |
| 36 | 37 | ||
| 37 | SRC_URI[sha256sum] = "dab18bbfcf5e347934cda664df75ce9fd912a5772686c40d3c805e53c08d6e43" | 38 | SRC_URI[sha256sum] = "dab18bbfcf5e347934cda664df75ce9fd912a5772686c40d3c805e53c08d6e43" |
