This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
inconsistent error reporting in g++
- To: gcc-bugs at gcc dot gnu dot org
- Subject: inconsistent error reporting in g++
- From: Igor Sheyn <sheyn at cs dot bu dot edu>
- Date: Tue, 13 Jun 2000 18:45:53 -0400
Hi,
consider the following 2 programs:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
int ff(int x)
{
char *s = (2>1)? "a": "b";
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
int ff(int x)
{
char *s = (x>1)? "a": "b";
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
g++ 2.96 compiles the first one fine, but when compiling the 2nd one, gives
the following error:
xyu.c: In function `int ff (int)':
xyu.c:3: cannot convert `const char *' to `char *' in initialization
I can understand this cast-related error, but how come g++ lets it go
unreported in the 1st case?
Thanks
Igor