This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/79178] New: Configuration tests for ISO-C99 support use invalid standards compliance specs


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79178

            Bug ID: 79178
           Summary: Configuration tests for ISO-C99 support use invalid
                    standards compliance specs
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: keith.marshall at mailinator dot com
  Target Milestone: ---

When building for mingw32, libstdc++-v3 configure uses an inappropriate
-std=... spec, when testing for availability of ISO-C99 feature support in
<stdlib.h>, <stdio.h> etc.  In config.log I see (simplified):

  ./gcc/xgcc -std=c++98 ... conftest.cpp

followed by a failing test for a bunch of functions which should be available
when ISO-C99 is supported.  mingw32 does support all of the functions tested,
but requires an appropriate __STDC_VERSION__ [>= 199901L] or __cplusplus [>=
201103L] spec for the prototypes to be declared.  Since the ISO-C++ standard
didn't add support for e.g. strtoll() until C++11, it is inappropriate to test
for its availability using a C++ compiler supporting only the earlier C++98;
the test (naturally) fails, causing _GLIBCXX_USE_C99 to remain undefined in the
resultant bits/c++config.h header, so breaking the resultant compiler behaviour
under -std=c++11.

A correct test would be to either compile (as C code) for -std=c99, or, if you
must use C++, then the minimum required standard for a correct test would be
-std=c++11; -std=c++98, which sets __cplusplus to only 199711L, is just plain
wrong.

For corresponding MinGW.org bug report, see
https://sourceforge.net/p/mingw/bugs/2335/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]