glibc/glibc-upstream-2.34-378.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

87 lines
3.2 KiB
Diff

commit 6ff61a51459d141782fbcc32ae81c0ef1954dad6
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon Oct 4 19:10:43 2021 +0000
Fix stdio-common tests for GCC 12 -Waddress
My glibc bot shows failures building the testsuite with GCC mainline
across all architectures:
tst-vfprintf-width-prec.c: In function 'do_test':
tst-vfprintf-width-prec.c:90:16: error: the comparison will always evaluate as 'false' for the address of 'result' will never be NULL [-Werror=address]
90 | if (result == NULL)
| ^~
tst-vfprintf-width-prec.c:89:13: note: 'result' declared here
89 | wchar_t result[100];
| ^~~~~~
This is clearly a correct warning; the comparison against NULL is
clearly a cut-and-paste mistake from an earlier case in the test that
does use calloc. Thus, remove the unnecessary check for NULL shown up
by the warning.
Similarly, two other tests have bogus comparisons against NULL; remove
those as well:
scanf14a.c:95:13: error: the comparison will always evaluate as 'false' for the address of 'fname' will never be NULL [-Werror=address]
95 | if (fname == NULL)
| ^~
scanf14a.c:93:8: note: 'fname' declared here
93 | char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
| ^~~~~
scanf16a.c:125:13: error: the comparison will always evaluate as 'false' for the address of 'fname' will never be NULL [-Werror=address]
125 | if (fname == NULL)
| ^~
scanf16a.c:123:8: note: 'fname' declared here
123 | char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
| ^~~~~
Tested with build-many-glibcs.py (GCC mainline) for aarch64-linux-gnu.
(cherry picked from commit a312e8fe6d89f5eae6a4583d5db577121e61c0b5)
diff --git a/stdio-common/scanf14a.c b/stdio-common/scanf14a.c
index 12adcff5a4970da1..b37712d1c673fa3a 100644
--- a/stdio-common/scanf14a.c
+++ b/stdio-common/scanf14a.c
@@ -92,8 +92,6 @@ main (void)
char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
- if (fname == NULL)
- FAIL ();
/* Create a temporary file. */
int fd = mkstemp (fname);
diff --git a/stdio-common/scanf16a.c b/stdio-common/scanf16a.c
index 400d85a54e81c3cb..74d0295c97f73b14 100644
--- a/stdio-common/scanf16a.c
+++ b/stdio-common/scanf16a.c
@@ -122,8 +122,6 @@ main (void)
char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
sprintf (fname, "%s/tst-scanf16.XXXXXX", tmpdir);
- if (fname == NULL)
- FAIL ();
/* Create a temporary file. */
int fd = mkstemp (fname);
diff --git a/stdio-common/tst-vfprintf-width-prec.c b/stdio-common/tst-vfprintf-width-prec.c
index 3192fd797ad4ea90..278d57f739f576e9 100644
--- a/stdio-common/tst-vfprintf-width-prec.c
+++ b/stdio-common/tst-vfprintf-width-prec.c
@@ -87,12 +87,6 @@ do_test (void)
}
{
wchar_t result[100];
- if (result == NULL)
- {
- printf ("error: calloc (%d, %zu): %m", ret + 1, sizeof (wchar_t));
- return 1;
- }
-
ret = swprintf (result, 100, L"%133000.999999999x", 17);
if (ret >= 0)
{