Re: [PATCH] wifi: rtw88: Add __nonstring annotations for unterminated strings

From: Ping-Ke Shih
Date: Wed Mar 12 2025 - 21:29:22 EST


Kees Cook <kees@xxxxxxxxxx> wrote:

> 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.
>
> Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1]
> Cc: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> Cc: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> Cc: linux-wireless@xxxxxxxxxxxxxxx
> Signed-off-by: Kees Cook <kees@xxxxxxxxxx>

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

d58ad77d5cc2 wifi: rtw88: Add __nonstring annotations for unterminated strings

---
https://github.com/pkshih/rtw.git