wifi: virt_wifi: Add __nonstring annotations for unterminated strings
PATCH v2 1/1 wifi: virt_wifi: 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: Eric Dumazet <[email protected]>
Cc: En-Wei Wu <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: [email protected]
--- drivers/net/wireless/virtual/virt_wifi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/virtual/virt_wifi.c +1 -1
@@ -146,7 +146,7 @@ static void virt_wifi_inform_bss(struct wiphy *wiphy)static const struct {u8 tag;u8 len; -u8 ssid[8 ]; + u8 ssid[8] __nonstring; } __packed ssid = { .tag =WLAN_EID_SSID , .len =VIRT_WIFI_SSID_LEN ,
Signature · 1 line
2.34.1