glibc/glibc-upstream-2.34-377.patch
Florian Weimer ad85e10075 Sync with upstream branch release/2.34/master
Upstream commit: commit 6484ae5b8c4d4314f748e4d3c9a9baa5385e57c5

- malloc: Fix -Wuse-after-free warning in tst-mallocalign1 [BZ #26779]
- s_sincosf.h: Change pio4 type to float [BZ #28713]
- math: Properly cast X_TLOSS to float [BZ #28713]
- Regenerate ulps on x86_64 with GCC 12
- Avoid -Wuse-after-free in tests [BZ #26779].
- Fix build of nptl/tst-thread_local1.cc with GCC 12
- Fix stdio-common tests for GCC 12 -Waddress
- Fix stdlib/tst-setcontext.c for GCC 12 -Warray-compare
- resolv: Avoid GCC 12 false positive warning [BZ #28439].
- intl: Avoid -Wuse-after-free [BZ #26779]
- elf: Drop elf/tls-macros.h in favor of __thread and tls_model attributes [BZ #28152] [BZ #28205]
- time: Set daylight to 1 for matching DST/offset change (RHBZ#2155352)
- elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10 (BZ# 29776)
- time: Use 64 bit time on tzfile
- nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
- nis: Build libnsl with 64 bit time_t
- Use LFS and 64 bit time for installed programs (BZ #15333)

Resolves: #2155352
Related: #2160734
2023-01-17 09:30:20 +01:00

35 lines
1.3 KiB
Diff

commit 26c7c6bac9da305b634a661aa491dae2756581ec
Author: Joseph Myers <joseph@codesourcery.com>
Date: Tue Oct 5 14:25:40 2021 +0000
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)
diff --git a/stdlib/tst-setcontext.c b/stdlib/tst-setcontext.c
index 1b511708c1469444..1c2925bb760c9eb4 100644
--- a/stdlib/tst-setcontext.c
+++ b/stdlib/tst-setcontext.c
@@ -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);