This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25992] conditional expression and strings literal
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2006 05:02:36 -0000
- Subject: [Bug c++/25992] conditional expression and strings literal
- References: <bug-25992-12082@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from bangerth at dealii dot org 2006-03-08 05:02 -------
Confirmed. These two lines should behave the same, but don't:
--------------
extern bool flag;
int main()
{
char* p;
p = (true ? "a" : "lalala" );
p = (flag ? "a" : "lalala" );
}
--------------
g/x> /home/bangerth/bin/gcc-4.2*/bin/c++ -c x.cc -Wwrite-strings
x.cc: In function ‘int main()’:
x.cc:5: warning: deprecated conversion from string constant to
‘char*’'
x.cc:6: error: invalid conversion from ‘const char*’ to
‘char*’
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2006-03-08 05:02:36
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25992