mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-05 03:01:05 +00:00
Fix stdlib/tst-setcontext.c for GCC 12 -Warray-compare
Building stdlib/tst-setcontext.c fails with GCC mainline:
tst-setcontext.c: In function 'f2':
tst-setcontext.c:61:16: error: comparison between two arrays [-Werror=array-compare]
61 | if (on_stack < st2 || on_stack >= st2 + sizeof (st2))
| ^
tst-setcontext.c:61:16: note: use '&on_stack[0] < &st2[0]' to compare the addresses
The comparison in this case is deliberate, so adjust it as suggested
in that note.
Tested with build-many-glibcs.py (GCC mainline) for aarch64-linux-gnu.
(cherry picked from commit a0f0c08e4f
)
This commit is contained in:
parent
92d5c52aaa
commit
26c7c6bac9
@ -58,7 +58,7 @@ f2 (void)
|
||||
puts ("start f2");
|
||||
|
||||
printf ("&on_stack=%p\n", on_stack);
|
||||
if (on_stack < st2 || on_stack >= st2 + sizeof (st2))
|
||||
if (&on_stack[0] < &st2[0] || &on_stack[0] >= st2 + sizeof (st2))
|
||||
{
|
||||
printf ("%s: memory stack is not where it belongs!", __FUNCTION__);
|
||||
exit (1);
|
||||
|
Loading…
Reference in New Issue
Block a user