diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2017-01-13 12:09:13 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2017-01-13 12:09:13 +0000 |
commit | 2252a8025df20cb5c58659cde04ac0ee0eee3ee1 (patch) | |
tree | 7409cd5362bbab1784a96fbdfb5284ad35c4d7b6 /fixincludes/inclhack.def | |
parent | a181b2bcd7d3d8e7af0f4503b5425ea0b5738c82 (diff) | |
download | gcc-2252a8025df20cb5c58659cde04ac0ee0eee3ee1.zip gcc-2252a8025df20cb5c58659cde04ac0ee0eee3ee1.tar.gz gcc-2252a8025df20cb5c58659cde04ac0ee0eee3ee1.tar.bz2 |
Only declare gets for C++ < 2014 on Solaris (PR libstdc++/78979)
PR libstdc++/78979
* inclhack.def (solaris_gets_c11, solaris_gets_cxx14)
(solaris_std_gets_cxx14, solaris_stdlib_noreturn): New fixes.
* fixincl.x: Regenerate.
* tests/base/iso/stdio_iso.h [SOLARIS_GETS_C11_CHECK,
SOLARIS_GETS_CXX14_CHECK, SOLARIS_STD_GETS_CXX14_CHECK,
SOLARIS_STDLIB_NORETURN_CHECK]: New tests.
From-SVN: r244428
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 240fc74..03a267b 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -3593,6 +3593,43 @@ fix = { }; /* + * Solaris <iso/stdio_iso.h> should deprecate gets before C11. + */ +fix = { + hackname = solaris_gets_c11; + mach = "*-*-solaris2*"; + files = "iso/stdio_iso.h"; + select = "(extern char[ \t]*\\*gets\\(char \\*\\));"; + + c_fix = format; + c_fix_arg = "#if __STDC_VERSION__ < 201112L && __cplusplus < 201402L\n" + "%1 __attribute__((__deprecated__));\n" + "#endif"; + + test_text = "extern char *gets(char *);"; +}; + +/* + * Solaris <iso/stdio_iso.h> shouldn't declare gets for C++14. + */ +fix = { + hackname = solaris_gets_cxx14; + mach = "*-*-solaris2*"; + files = "iso/stdio_iso.h"; + select = <<- _EOSelect_ +(#if __STDC_VERSION__ < 201112L) +(extern char \*gets\(char \*\) __ATTR_DEPRECATED;) +_EOSelect_; + c_fix = format; + c_fix_arg = "%1 && __cplusplus < 201402L\n%2"; + + test_text = <<- _EOText_ +#if __STDC_VERSION__ < 201112L +extern char *gets(char *) __ATTR_DEPRECATED; +_EOText_; +}; + +/* * Sun Solaris 2 has a version of sys/int_const.h that defines * UINT8_C and UINT16_C to unsigned constants. */ @@ -3982,6 +4019,21 @@ fix = { }; /* + * Solaris <stdio.h> shouldn't use std::gets for C++14. + */ +fix = { + hackname = solaris_std_gets_cxx14; + mach = "*-*-solaris2*"; + files = "stdio.h"; + select = "using std::gets;"; + + c_fix = format; + c_fix_arg = "#if __cplusplus < 201402L\n%0\n#endif"; + + test_text = "using std::gets;"; +}; + +/* * Sun Solaris 8 has what appears to be some gross workaround for * some old version of their c++ compiler. G++ doesn't want it * either, but doesn't want to be tied to SunPRO version numbers. @@ -4000,6 +4052,21 @@ fix = { }; /* + * Solaris <stdlib.h> shouldn't use _Noreturn, breaks with C++. + */ +fix = { + hackname = solaris_stdlib_noreturn; + mach = "*-*-solaris2*"; + files = "iso/stdlib_c99.h"; + select = "(extern) _Noreturn (void quick_exit\\(int\\));"; + + c_fix = format; + c_fix_arg = "%1 %2 __attribute__((__noreturn__));"; + + test_text = "extern _Noreturn void quick_exit(int);"; +}; + +/* * a missing semi-colon at the end of the statsswtch structure definition. */ fix = { |