Re: Compendiums of compiler warning/error messages mapped to actual code problems?



David Mathog wrote:
Do any of you happen to have links to compendiums (or heaven forbid, an actual manual) which maps compiler warnings and errors to examples of actual code problems? In this case I'm specifically looking for one
for gcc. The general problem is of course that the compiler messages must be short, and that tends to make them so cryptic that it isn't always immediately obvious what the problem is. It almost makes me long
for the days when the IBM compilers would describe the problem with just a number - which wasn't useful in and of itself, but was quite helpful given the umpteen page messages manual which contained excellent descriptions of each problem, indexed by that number.

Anyway, this comes up (again) because I just figured out that the gcc error:

foo.c:351: error: two or more data types in declaration specifiers

Which was cited for this line (the first prototype):

void handle_message(char *string);

was actually the result of the immediately preceding struct definition:

struct datastructure{
int this;
int that;
/*etc. all valid *
}
^ note the missing semicolon after the closing brace.

In this instance the message was not completely devoid of useful information, since it at least localized the issue to the vicinity of line 351, even if the actual error was on the first non blank line preceding it. The message though - not too helpful. Why not "did not find expected semicolon"? For this particular message google wasn't
all that helpful - in the first few results it turned up examples of the message but not an explanation of what caused it.

Regards,

David Mathog


This is a quality of implementation issue...

For instance this program
struct datastructure{
int this;
int that;
}

int main(void)
{
}

provokes with lcc-win:
Error twarn.c: 6 missing semicolon after structure declaration
Warning twarn.c: 6 multiple use of 'int'
1 error, 1 warning

Better isn't it?

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.



Relevant Pages

  • Re: Parameter Name Warning?
    ... the names on the declarations do not matter, it should perhaps give a warning regarding different names being used. ... > there is more to those names than just what the compiler does with them. ... > You know only what you get in the header. ... >>> int main ...
    (microsoft.public.vc.language)
  • Re: is order urgent doubt
    ... Which *compiler* are you using? ... layout of the warning messages.) ... i = sizeof(long int); ... about the code in the editor vs. the code in the source file. ...
    (comp.lang.c)
  • Re: Whats the deal with size_t?
    ... ES> allowed to emit diagnostics that C doesn't require. ... in warning about a signed to unsigned conversion. ... a size_t to an int it is quite justified in warning about the reverse, ... The compiler is also quite justified in warning if you use a signed ...
    (comp.lang.c)
  • Re: matrix stuff (solving b = A*x) --> using numerical recipes
    ... but then I removed it since I couldn't see any compiler warnings/errors without stdio.h). ... turn the warning level up to the maximum ... void banmul(float **a, unsigned long n, int left, int right, float x, float b); ...
    (comp.lang.c)
  • Re: Compendiums of compiler warning/error messages mapped to actual code problems?
    ... int this; ... Warning twarn.c: ... There are numerous nice features of lcc-win. ...
    (comp.lang.c)