wifi: zd1211rw: Add __nonstring annotations for unterminated strings
PATCH v2 1/1 wifi: zd1211rw: Add __nonstring annotations for unterminated strings
When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to and correctly identify the char array as "not a C string" and thereby eliminate the warning.
Signed-off-by Kees Cook <[email protected]>
---
v1: https://lore.kernel.org/lkml/[email protected]/
v2: correctly split and fix subject
Cc: Johannes Berg <[email protected]>
Cc: Miri Korenblit <[email protected]>
Cc: Alexander Wetzel <[email protected]>
Cc: Emmanuel Grumbach <[email protected]>
Cc: Shaul Triebitz <[email protected]>
Cc: [email protected]
--- drivers/net/wireless/zydas/zd1211rw/zd_mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/zydas/zd1211rw/zd_mac.c +1 -1
@@ -21,7 +21,7 @@struct zd_reg_alpha2_map {u32 reg; -char alpha2[2 ]; + char alpha2[2] __nonstring; };static struct zd_reg_alpha2_map reg_alpha2_map[] = {
Signature · 1 line
2.34.1