osmith submitted this change.
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
utils: ignore Waddress in IPA_STR_FROM_ASN
When building with -Werror, GCC complains about this assert in the macro:
#define IPA_STR_FROM_ASN(asn1_obj) ({ \
char *__str; \
assert(asn1_obj); \ <----------------------
__str = IPA_ALLOC_N((asn1_obj)->size + 1); \
assert(__str); \
memcpy(__str, (asn1_obj)->buf, (asn1_obj)->size); \
__str[(asn1_obj)->size] = '\0'; \
__str; \
})
For example:
…/src/ipa/libipa/es10b_get_eim_cfg_data.c:48:21: error: the comparison will always evaluate as ‘true’ for the address of ‘eimId’ will never be NULL [-Werror=address]
48 | IPA_STR_FROM_ASN(&res->res->eimConfigurationDataList.list.array[i]->eimId);
Add pragmas to ignore the error, so it can still assert if somebody
should pass NULL to the macro.
Change-Id: Ia2ef30880dd3e5b2ab90eedd0046a95a22614a81
---
M src/ipa/libipa/utils.h
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/ipa/libipa/utils.h b/src/ipa/libipa/utils.h
index 8ae5b66..2f95ecd 100644
--- a/src/ipa/libipa/utils.h
+++ b/src/ipa/libipa/utils.h
@@ -100,7 +100,10 @@
* \returns null terminated char array with contents of asn1_obj. */
#define IPA_STR_FROM_ASN(asn1_obj) ({ \
char *__str; \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Waddress\"") \
assert(asn1_obj); \
+ _Pragma("GCC diagnostic pop") \
__str = IPA_ALLOC_N((asn1_obj)->size + 1); \
assert(__str); \
memcpy(__str, (asn1_obj)->buf, (asn1_obj)->size); \
To view, visit change 42861. To unsubscribe, or for help writing mail filters, visit settings.