mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Shuah Khan <shuah@kernel.org>,
	Rodrigo Campos <rodrigo@sdfg.com.ar>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/nolibc: avoid GCC 15 -Wunterminated-string-initialization
Date: Mon, 23 Jun 2025 23:37:12 +0200	[thread overview]
Message-ID: <20250623213712.GA30367@1wt.eu> (raw)
In-Reply-To: <20250623-nolibc-nonstring-v1-1-11282204766a@weissschuh.net>

On Mon, Jun 23, 2025 at 11:34:32PM +0200, Thomas Weißschuh wrote:
> On GCC 15 the following warnings is emitted:
> 
> nolibc-test.c: In function 'run_stdlib':
> nolibc-test.c:1416:32: warning: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (11 chars into 10 available) [-Wunterminated-string-initialization]
>  1416 |                 char buf[10] = "test123456";
>       |                                ^~~~~~~~~~~~
> 
> Increase the size of buf to avoid the warning.
> 
> It would also be possible to use __attribute__((nonstring)) but that
> would require some ifdeffery to work with older compilers.

I agree with you, that's not an important enough fight to spend time
on :-)

> Fixes: 1063649cf531 ("selftests/nolibc: Add tests for strlcat() and strlcpy()")
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Acked-by: Willy Tarreau <w@1wt.eu>

willy

  reply	other threads:[~2025-06-23 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 21:34 Thomas Weißschuh
2025-06-23 21:37 ` Willy Tarreau [this message]
2025-06-24 11:08 ` Rodrigo Campos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250623213712.GA30367@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=rodrigo@sdfg.com.ar \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®