]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Don't test for __unused on Glibc targets
authorXi Ruoyao <xry111@xry111.site>
Thu, 12 Feb 2026 18:46:05 +0000 (18:46 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 12 Feb 2026 19:36:28 +0000 (19:36 +0000)
x86_64 glibc has started to use it since the 2.43 release, but is
expected to fix it before the 2.44 release.

Link: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b9579342c68b#patch67
libstdc++-v3/ChangeLog:

* testsuite/17_intro/badnames.cc (__unused): Do not define.
* testsuite/17_intro/names.cc [glibc == 2.43] (__unused): Undef.

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/testsuite/17_intro/badnames.cc
libstdc++-v3/testsuite/17_intro/names.cc

index ff590fcdf4d9445d93e81a6c3cb9b0ea3995520f..de4d94faf14c0b1bfc6b0b91681367c17fe9b164 100644 (file)
@@ -67,7 +67,7 @@
 
 // BSD adds:
 #define __used         __used is a BADNAME
-#define __unused       __unused is a BADNAME
+        // __unused    (glibc uses this so can't test here)
         // __inline    (glibc uses this so can't test here)
         // _Complex    (glibc uses this so can't test here)
 #define __istype       __istype is a BADNAME
index 106acfa641b8cdb38293435c9442e2cefe0e8f26..404cc93e9630decbe20673b5fbf344aee6eb6279 100644 (file)
 #if defined (__linux__) || defined (__gnu_hurd__)
 #if __has_include(<features.h>)
 #include <features.h>
-#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 19
+#if __GLIBC__ == 2 && (__GLIBC_MINOR__ < 19 || __GLIBC_MINOR__ == 43)
 // Glibc defines this prior to 2.19
 #undef __unused
 #endif