Re: Here's a good one...
From: Keith Thompson (kst-u_at_mib.org)
Date: 06/08/04
- Next message: Bun Head: "union"
- Previous message: Me: "Re: Unicode Initialization."
- In reply to: Dan Pop: "Re: Here's a good one..."
- Next in thread: Dan Pop: "Re: Here's a good one..."
- Reply: Dan Pop: "Re: Here's a good one..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 08 Jun 2004 20:50:04 GMT
Dan.Pop@cern.ch (Dan Pop) writes:
[...]
> Always look at earliest (in terms of line numbers) diagnostic reported
> by the compiler and ignore the rest. Fix it, recompile and follow
> the same strategy if there are still diagnostics.
That's good advice for beginners, and it certainly applies to the OP's
code.
The more advanced version is:
Always look at the earliest diagnostic reported by the compiler.
Anything following a syntax error can probably be ignored; typical C
compilers don't recover well from syntax errors. But semantic errors
(type mismatches, etc.) typically don't cause the same kind of
cascades that syntax errors do.
The very first error message you see is almost certainly meaningful.
Error messages up to and including the first reported syntax error are
likely to be meaningful, but don't spend too much time on them; if you
can't figure out the error, fix the first one (or the first N) and
recompile.
Error messages following a syntax error are likely to be meaningless
cascade errors.
Errors involving typedef names often behave like syntax errors (since
a typedef name is effectively a keyword in most contexts).
Having said all that, fixing each error one at a time and recompiling
for each fix isn't an unreasonable approach. (I usually try to fix as
many errors as I can, because I typically build large software
packages with multiple levels of auto-configuration and Makefiles;
re-running a single compilation isn't always practical, and the entire
build can take hours. A novice isn't likely to be in that situation.)
-- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.
- Next message: Bun Head: "union"
- Previous message: Me: "Re: Unicode Initialization."
- In reply to: Dan Pop: "Re: Here's a good one..."
- Next in thread: Dan Pop: "Re: Here's a good one..."
- Reply: Dan Pop: "Re: Here's a good one..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|