[Bug libstdc++/78979] New: 27_io/headers/cstdio/functions_neg.cc FAILs on Solaris
ro at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 3 14:22:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78979
Bug ID: 78979
Summary: 27_io/headers/cstdio/functions_neg.cc FAILs on Solaris
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: ro at gcc dot gnu.org
CC: redi at gcc dot gnu.org
Target Milestone: ---
Host: *-*-solaris2.*
Target: *-*-solaris2.*
Build: *-*-solaris2.*
The 27_io/headers/cstdio/functions_neg.cc testcase started to FAIL on Solaris
between between 20160930 and 20161003:
FAIL: 27_io/headers/cstdio/functions_neg.cc (test for errors, line 24)
This is
using std::gets; // { dg-error "has not been declared" }
obviously caused by
2016-09-30 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/77795
* acinclude.m4 (GLIBCXX_CHECK_STDIO_PROTO): Use -std=gnu++11 to check
for gets.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/c_global/cstdio [!_GLIBCXX_HAVE_GETS] (gets): Only declare
for C++98 and C++11.
* include/c_std/cstdio [!_GLIBCXX_HAVE_GETS] (gets): Likewise.
* testsuite/27_io/headers/cstdio/functions_neg.cc: New test.
Ultimately, this happens because config/sol2.h (TARGET_OS_CPP_BUILTINS) always
has
if (c_dialect_cxx ()) \
{ \
builtin_define ("__STDC_VERSION__=199901L");\
so enabling the gets decl in <iso/stdio_iso.h>, which is
#if __STDC_VERSION__ < 201112L
extern char *gets(char *) __ATTR_DEPRECATED;
#endif
even for C++11 mode. The gcc-5 and gcc-6 branches are also affected. I'm
uncertain how best to proceed. Conditionalizing the __STDC_VERSION__ define
based on cxx_dialect
might be an option...
Rainer
More information about the Gcc-bugs
mailing list