This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20475] static_cast falsely allows const to be cast away
- From: "schlie at comcast dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 May 2005 22:45:28 -0000
- Subject: [Bug c++/20475] static_cast falsely allows const to be cast away
- References: <20050314190251.20475.dcb314@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From schlie at comcast dot net 2005-05-15 22:45 -------
(In reply to comment #2)
> Yup, string literal should have type 'const char *'.
I believe 'static const char []' would seem most correct?
(where although 'static const' may be cast away, there's no guarantee
that any attempted write will not only potentially fail, but may generate
terminal exception if the string literal is stored in physically write protected
memory or physically in ROM)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20475