bootconfig: give the footer size static_assert a message
Subsystems (3)
Sasha Levin
maintainerPATCH 1/1 bootconfig: give the footer size static_assert a message
static_assert() without a message is a C23 feature, so clang warns:
main.c:498:56: warning: '_Static_assert' with no message is a C23 extension [-Wc23-extensions]
Add a message.
Fixes 6ed5e20466c79 ("bootconfig: Fix unaligned access when building footer")
Assisted-by LLM
Signed-off-by Sasha Levin <[email protected]>
--- tools/bootconfig/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/bootconfig/main.c +2 -1
@@ -495,7 +495,8 @@ static int apply_xbc(const char *path, const char *xbc_path) footer.size =htole32 (size); footer.csum =htole32 (csum);memcpy (footer.magic,BOOTCONFIG_MAGIC ,BOOTCONFIG_MAGIC_LEN ); -static_assert (sizeof (footer) ==BOOTCONFIG_FOOTER_SIZE ); +static_assert (sizeof (footer) ==BOOTCONFIG_FOOTER_SIZE , +"bootconfig footer size mismatch" );memcpy (data + size, &footer,BOOTCONFIG_FOOTER_SIZE ); total_size = size +BOOTCONFIG_FOOTER_SIZE ;
Signature · 1 line
2.53.0
Masami Hiramatsu (Google)
maintainerQuoted 10 lines · Sasha Levin
static_assert()without a message is a C23 feature, so clang warns:main.c:498:56: warning: '
_Static_assert' with no message is a C23 extension [-Wc23-extensions]Add a message.
Fixes 6ed5e20466c79 ("bootconfig: Fix unaligned access when building footer")Assisted-by LLMSigned-off-by Sasha Levin <[email protected]>
Looks good to me. Let me pick it.
Thanks!
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>