]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix stdlib/tst-setcontext.c for GCC 12 -Warray-compare
authorJoseph Myers <joseph@codesourcery.com>
Tue, 5 Oct 2021 14:25:40 +0000 (14:25 +0000)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 11 Jan 2023 13:11:21 +0000 (14:11 +0100)
commit26c7c6bac9da305b634a661aa491dae2756581ec
treeae788066e784bc3a351fef5a69e6868de22ed08b
parent92d5c52aaac0fa8e58b92e96bf2025d6848a2845
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 a0f0c08e4fe18e78866539b0571f8e4b57dba7a3)
stdlib/tst-setcontext.c