Commit aa662d12 authored by Willy Tarreau's avatar Willy Tarreau Committed by Paul E. McKenney

tools/nolibc: tests: fix build on non-c99 compliant compilers

Commit 97357168 ("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: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent e7654c3f
...@@ -671,8 +671,9 @@ static int smash_stack(void) ...@@ -671,8 +671,9 @@ static int smash_stack(void)
{ {
char buf[100]; char buf[100];
volatile char *ptr = buf; volatile char *ptr = buf;
size_t i;
for (size_t i = 0; i < 200; i++) for (i = 0; i < 200; i++)
ptr[i] = 'P'; ptr[i] = 'P';
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment