public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc
@ 2023-01-27 8:51 jakub at gcc dot gnu.org
2023-01-27 8:52 ` [Bug libstdc++/108568] [13 Regression] " jakub at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-27 8:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
Bug ID: 108568
Summary: FAILs in 17_intro/names.cc
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
On gcc112 I'm seeing
FAIL: 17_intro/names.cc (test for excess errors)
FAIL: experimental/names.cc (test for excess errors)
These are because glibc < 2.19 used __unused as field member of various
structs,
including mcontext_t in sys/ucontext.h on ppc64le.
This was changed in glibc with
https://gcc.gnu.org/pipermail/libc-alpha/2013-November/045766.html
names.cc even has
#ifdef __GLIBC_PREREQ
#if ! __GLIBC_PREREQ(2, 19)
// Glibc defines this prior to 2.19
#undef __unused
#endif
#endif
for it, but it doesn't work. The reason is that __GLIBC_PREREQ is defined in
<features.h> but nothing included that header before this spot (it is included
later
from bits/stdc++.h).
Can't it use
#if __GLIBC__ == 1 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 19)
instead? Or just
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 19
(because who knows what glibc 1 actually used, that was 1996 and already in
1997 we had glibc 2.x).
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/108568] [13 Regression] FAILs in 17_intro/names.cc
2023-01-27 8:51 [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc jakub at gcc dot gnu.org
@ 2023-01-27 8:52 ` jakub at gcc dot gnu.org
2023-01-27 8:54 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-27 8:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
Summary|FAILs in 17_intro/names.cc |[13 Regression] FAILs in
| |17_intro/names.cc
Priority|P3 |P1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
__unused in the test has been added in November 2022 and the glibc 2.19 tweak
in December, so this is a regression.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/108568] [13 Regression] FAILs in 17_intro/names.cc
2023-01-27 8:51 [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc jakub at gcc dot gnu.org
2023-01-27 8:52 ` [Bug libstdc++/108568] [13 Regression] " jakub at gcc dot gnu.org
@ 2023-01-27 8:54 ` jakub at gcc dot gnu.org
2023-01-27 9:19 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-27 8:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've unpacked the glibc 1.09.1 tarball and there isn't a single reference to
__unused, so I think just the simpler version is enough.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/108568] [13 Regression] FAILs in 17_intro/names.cc
2023-01-27 8:51 [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc jakub at gcc dot gnu.org
2023-01-27 8:52 ` [Bug libstdc++/108568] [13 Regression] " jakub at gcc dot gnu.org
2023-01-27 8:54 ` jakub at gcc dot gnu.org
@ 2023-01-27 9:19 ` jakub at gcc dot gnu.org
2023-01-27 19:13 ` cvs-commit at gcc dot gnu.org
2023-01-27 20:38 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-27 9:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Except that it doesn't work either, because even the __GLIBC__ and
__GLIBC_MINOR__ macros are defined in glibc headers.
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -252,12 +252,15 @@
#undef y
#endif
-#ifdef __GLIBC_PREREQ
-#if ! __GLIBC_PREREQ(2, 19)
+#if defined (__linux__) || defined (__gnu_hurd__)
+#if __has_include(<features.h>)
+#include <features.h>
+#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 19
// Glibc defines this prior to 2.19
#undef __unused
#endif
#endif
+#endif
#if __has_include(<newlib.h>)
// newlib's <sys/cdefs.h> defines these as macros.
seems to work. __GLIBC_PREREQ was introduced only 3 years after first glibc
2.x release.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/108568] [13 Regression] FAILs in 17_intro/names.cc
2023-01-27 8:51 [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc jakub at gcc dot gnu.org
` (2 preceding siblings ...)
2023-01-27 9:19 ` jakub at gcc dot gnu.org
@ 2023-01-27 19:13 ` cvs-commit at gcc dot gnu.org
2023-01-27 20:38 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-27 19:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:815e5740162d2d0b7b54031f72c201065016d58c
commit r13-5461-g815e5740162d2d0b7b54031f72c201065016d58c
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 27 20:11:20 2023 +0100
libstdc++: Fix up FAIL in 17_intro/names.cc on glibc < 2.19 [PR108568]
On gcc112 which has glibc 2.17 I've noticed
FAIL: 17_intro/names.cc (test for excess errors)
FAIL: experimental/names.cc (test for excess errors)
These are because glibc < 2.19 used __unused as field member of various
structs,
including mcontext_t in sys/ucontext.h on ppc64le.
This was changed in glibc with
https://gcc.gnu.org/pipermail/libc-alpha/2013-November/045766.html
names.cc even has
#ifdef __GLIBC_PREREQ
#if ! __GLIBC_PREREQ(2, 19)
// Glibc defines this prior to 2.19
#undef __unused
#endif
#endif
for it, but it doesn't work. The reason is that __GLIBC_PREREQ is defined
in
<features.h> but nothing included that header before this spot (it is
included later
from bits/stdc++.h).
The following patch on Linux/Hurd conditionally includes features.h to get
the needed macros before deciding if __unused should be undefined or not.
If needed, I could use __GLIBC_PREREQ then but would need to check if it is
defined and between 1996 and 1999 it wasn't.
2023-01-27 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/108568
* testsuite/17_intro/names.cc (__unused): For linux or GNU hurd
include features.h if present and then check __GLIBC__ and
__GLIBC_MINOR__ macros for glibc prior to 2.19, instead of testing
__GLIBC_PREREQ which isn't defined yet.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/108568] [13 Regression] FAILs in 17_intro/names.cc
2023-01-27 8:51 [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc jakub at gcc dot gnu.org
` (3 preceding siblings ...)
2023-01-27 19:13 ` cvs-commit at gcc dot gnu.org
@ 2023-01-27 20:38 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-27 20:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108568
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-27 20:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 8:51 [Bug libstdc++/108568] New: FAILs in 17_intro/names.cc jakub at gcc dot gnu.org
2023-01-27 8:52 ` [Bug libstdc++/108568] [13 Regression] " jakub at gcc dot gnu.org
2023-01-27 8:54 ` jakub at gcc dot gnu.org
2023-01-27 9:19 ` jakub at gcc dot gnu.org
2023-01-27 19:13 ` cvs-commit at gcc dot gnu.org
2023-01-27 20:38 ` jakub at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).