This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/1773] __cplusplus defined to 1, should be 199711L
- From: "andrew at ishiboo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 3 Aug 2011 20:18:03 +0000
- Subject: [Bug libstdc++/1773] __cplusplus defined to 1, should be 199711L
- Auto-submitted: auto-generated
- References: <bug-1773-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
Andrew Paprocki <andrew at ishiboo dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andrew at ishiboo dot com
--- Comment #104 from Andrew Paprocki <andrew at ishiboo dot com> 2011-08-03 20:17:26 UTC ---
Wow, just got bit by this 10 year old bug on Solaris 10. The following code
correctly errors with Sun's compiler:
#include <string.h>
int main() { char* foo = strchr("z", 'z'); return 0; }
"foo.c", line 2: Error: Cannot assign const char* to char*.
But under no invocation of g++ does this even print a warning (-Wall -Wextra
-Wcast-qual) because Solaris iso/string_iso.h only declares the return value
'const' when __cplusplus >= 199711L.