This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/2776: Wrong (misleading) error message in gcc 2.95.3
- From: Mirsad Todorovac <mtodorov at alu dot hr>
- To: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- Cc: gcc-bugs at gcc dot gnu dot org, <gcc-gnats at gcc dot gnu dot org>
- Date: Wed, 19 Feb 2003 19:48:38 +0100 (CET)
- Subject: Re: c/2776: Wrong (misleading) error message in gcc 2.95.3
On Wed, 19 Feb 2003, Wolfgang Bangerth wrote:
>
> > I apologize if I was wasting your precious timewith this as it now seems
> > not so important issue, but I wasted so much time resolving it that I
> > thought it was important to be resolved, or at least known issue.
> >
> > Thank you for your time. Mirsad
>
> No problem. This is just one of the cases where what you wanted would
> require the compiler to second-guess what was your original intention.
> Your example boiled down to
> char *p = hip hop step;
> The problem was the missing quotes (which the compiler can't know, since
> the three tokens came from the preprocessor, and there might be many
> possible interpretations of what the orginal intent was:
> char *p = "hip hop step";
> char *p = hip+hop+step; // hip=char*, hop,step=int
> char *p = hiphopstep; // hiphopstep=char*
> etc. There is just not something sensible the compiler can say here,
> except for "parse error" or so.
>
> With respect to the fact that the error message was totally
> incomprehensible: most experienced programmers know that if something is
> _really_ incomprehensible, the look at the preprocessed sources. I'd say
> this is for exactly the same kind of experience you just made :-(
Thank you for this explanation, which makes things much clearer. I
understand that AI is probably not a good thing to install in a compiler,
since a compiler has to be small and reliable, hasn't it? :-))
Be blessed,
M.