This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/2776: Wrong (misleading) error message in gcc 2.95.3


The following reply was made to PR c/2776; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
To: Mirsad Todorovac <mtodorov at alu dot hr>
Cc: gcc-bugs at gcc dot gnu dot org, <gcc-gnats at gcc dot gnu dot org>
Subject: Re: c/2776: Wrong (misleading) error message in gcc 2.95.3
Date: Wed, 19 Feb 2003 10:57:17 -0600 (CST)

 > 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 :-(
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth             email:            bangerth at ticam dot utexas dot edu
                               www: http://www.ticam.utexas.edu/~bangerth/
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]