From: Willy Tarreau <w@1wt.eu>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux@weissschuh.net, v@vda.io, linux-kernel@vger.kernel.org,
Willy Tarreau <w@1wt.eu>
Subject: [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers
Date: Sun, 2 Apr 2023 10:13:56 +0200 [thread overview]
Message-ID: <20230402081357.12078-2-w@1wt.eu> (raw)
In-Reply-To: <20230402081357.12078-1-w@1wt.eu>
Commit 9735716830f2 ("tools/nolibc: tests: add test for -fstack-protector")
brought a declaration inside the initialization statement of a for loop,
which breaks the build on compilers that do not default to c99
compatibility, making it more difficult to validate that the lib still
builds on such compilers. The fix is trivial, so let's move the
declaration to the variables block of the function instead. No backport
is needed.
Cc: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
---
tools/testing/selftests/nolibc/nolibc-test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 47013b78972e..6f2f109569a3 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -671,8 +671,9 @@ static int smash_stack(void)
{
char buf[100];
volatile char *ptr = buf;
+ size_t i;
- for (size_t i = 0; i < 200; i++)
+ for (i = 0; i < 200; i++)
ptr[i] = 'P';
return 1;
--
2.17.5
next prev parent reply other threads:[~2023-04-02 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-02 8:13 [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Willy Tarreau
2023-04-02 8:13 ` Willy Tarreau [this message]
2023-04-02 8:13 ` [PATCH 2/2] tools/nolibc: fix build of the test case using glibc Willy Tarreau
2023-04-02 17:13 ` [PATCH 0/2] tools/nolibc: assorted build fixes for nolibc-test in rare cases Paul E. McKenney
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=20230402081357.12078-2-w@1wt.eu \
--to=w@1wt.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=paulmck@kernel.org \
--cc=v@vda.io \
/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®