mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
Fix warning in setjmp/jmpbug.c.
This patch fixes a "set but not used" warning in setjmp/jmpbug.c. A variable is used only to store the result of alloca. A cast to void is added to avoid the warning, and the variable is made volatile to ensure the call to alloca isn't optimized away for being unused. Tested for x86_64. * setjmp/jmpbug.c (test): Make foo volatile and cast it to void.
This commit is contained in:
@@ -14,7 +14,7 @@ static void
|
||||
test (int x)
|
||||
{
|
||||
jmp_buf buf;
|
||||
char *foo;
|
||||
char *volatile foo;
|
||||
int arr[100];
|
||||
|
||||
arr[77] = x;
|
||||
@@ -25,6 +25,7 @@ test (int x)
|
||||
}
|
||||
|
||||
foo = (char *) alloca (128);
|
||||
(void) foo;
|
||||
sub5 (buf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user