Bug 103650 - [9 Regression] libstdc++ headers defined LT_OBJDIR and STDC_HEADERS
Summary: [9 Regression] libstdc++ headers defined LT_OBJDIR and STDC_HEADERS
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 11.2.1
: P3 normal
Target Milestone: 9.5
Assignee: Jonathan Wakely
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2021-12-10 14:49 UTC by Jonathan Wakely
Modified: 2022-05-09 16:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-04-04 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2021-12-10 14:49:06 UTC
#define LT_OBJDIR 99
#define STDC_HEADERS 99
#include <utility>
#if LT_OBJDIR != 99
# error LT_OBJDIR redefined
#endif
#if STDC_HEADERS != 99
# error STDC_HEADERS redefined
#endif


In file included from /usr/include/c++/11/utility:68,
                 from macros.C:3:
macros.C:4:5: error: token "".libs/"" is not valid in preprocessor expressions
    4 | #if LT_OBJDIR != 99
      |     ^~~~~~~~~
macros.C:8:3: error: #error STDC_HEADERS redefined
    8 | # error STDC_HEADERS redefined
      |   ^~~~~


With GCC 4.1 only STDC_HEADERS was defined:

macros.C:8:3: error: #error STDC_HEADERS redefined

So the definition of LT_OBJDIR in 4.3 and later (I can't check 4.2) is a regression.

We never asked for those macros, this is libtool and autoconf being "helpful".
Comment 1 CVS Commits 2022-01-17 12:10:29 UTC
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:fa092570fbaf3bb4202e518eb8beba146c464d9f

commit r12-6633-gfa092570fbaf3bb4202e518eb8beba146c464d9f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jan 17 11:24:35 2022 +0000

    libstdc++: Rename non-reserved macros in config header [PR103650]
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103650
            * include/Makefile.am: Rename LT_OBJDIR and STDC_HEADERS.
            * include/Makefile.in: Regenerate.
            * testsuite/17_intro/headers/c++1998/103650.cc: New test.
Comment 2 CVS Commits 2022-04-04 11:47:01 UTC
The releases/gcc-11 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0811a4dc39d6269f4087c25ed2be497fe027e756

commit r11-9765-g0811a4dc39d6269f4087c25ed2be497fe027e756
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jan 17 11:24:35 2022 +0000

    libstdc++: Rename non-reserved macros in config header [PR103650]
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103650
            * include/Makefile.am: Rename LT_OBJDIR and STDC_HEADERS.
            * include/Makefile.in: Regenerate.
            * testsuite/17_intro/headers/c++1998/103650.cc: New test.
    
    (cherry picked from commit fa092570fbaf3bb4202e518eb8beba146c464d9f)
Comment 3 CVS Commits 2022-04-26 13:12:36 UTC
The releases/gcc-10 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:24eb54cc3b564f2bfa6d7e2fa26ddc82c8b2dc18

commit r10-10569-g24eb54cc3b564f2bfa6d7e2fa26ddc82c8b2dc18
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jan 17 11:24:35 2022 +0000

    libstdc++: Rename non-reserved macros in config header [PR103650]
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103650
            * include/Makefile.am: Rename LT_OBJDIR and STDC_HEADERS.
            * include/Makefile.in: Regenerate.
            * testsuite/17_intro/headers/c++1998/103650.cc: New test.
    
    (cherry picked from commit fa092570fbaf3bb4202e518eb8beba146c464d9f)
Comment 4 CVS Commits 2022-05-09 16:39:45 UTC
The releases/gcc-9 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:de3549eb7bba1af6894b6ad781b6943b16883f2b

commit r9-10053-gde3549eb7bba1af6894b6ad781b6943b16883f2b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jan 17 11:24:35 2022 +0000

    libstdc++: Rename non-reserved macros in config header [PR103650]
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103650
            * include/Makefile.am: Rename LT_OBJDIR and STDC_HEADERS.
            * include/Makefile.in: Regenerate.
            * testsuite/17_intro/headers/c++1998/103650.cc: New test.
    
    (cherry picked from commit fa092570fbaf3bb4202e518eb8beba146c464d9f)
Comment 5 Jonathan Wakely 2022-05-09 16:49:30 UTC
Fixed for 9.5, 10.4, 11.3 and 12.1