Re: [PATCH v2] net: macb: Add __nonstring annotations for unterminated strings

2025-03-12 Thread Kees Cook
On Tue, Mar 11, 2025 at 04:04:24PM -0700, Bill Wendling wrote: > On Tue, Mar 11, 2025 at 3:44 PM Kees Cook 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

Re: [PATCH v2] net: macb: Add __nonstring annotations for unterminated strings

2025-03-11 Thread Bill Wendling
On Tue, Mar 11, 2025 at 3:44 PM Kees Cook 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 corr

[PATCH v2] net: macb: Add __nonstring annotations for unterminated strings

2025-03-11 Thread Kees Cook
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 thereb