linux-gbmc(stable): Annotate stmmac stat_string with __nonstring
When building linux-gbmc-stable (6.14.1) with CONFIG_WERROR enabled,
GCC 15 produces the following compiler error:
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:117:53: error:
initializer-string for array of 'char' truncates NUL terminator but
destination lacks 'nonstring' attribute (33 chars into 32 available)
[-Werror=unterminated-string-initialization]
117 | STMMAC_STAT(ptp_rx_msg_type_pdelay_follow_up),
| ^
In struct stmmac_stats, stat_string is a fixed-size character array of
ETH_GSTRING_LEN (32) bytes. The statistic identifier
ptp_rx_msg_type_pdelay_follow_up stringifies to exactly 32 characters.
Initializing stat_string with this 32-character string literal leaves
no space for a terminating NUL byte, causing GCC 15 to flag it with
-Wunterminated-string-initialization.
Add a kernel patch that annotates stat_string with the __nonstring
attribute in struct stmmac_stats to declare that the character array
is not required to be NUL-terminated. Add this patch to SRC_URI in
linux-gbmc_stable.bb to resolve the build failure.
Fixes: 80892bc818ea ("linux-gbmc(stable): 6.13 -> 6.14")
Tested: Built
Fusion-Link: fusion2 N/A
Google-Bug-Id: 558753346
Change-Id: Ib0d912cc945393c444ba354ef328fb1c380d9107
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2 files changed