Mail Archives: djgpp/1998/08/30/10:29:07
On Fri, 28 Aug 1998, Nate Eldredge wrote:
> It detects it quite well, but doesn't always explain it well. I once
> had a bug involving a missing parenthesis in a complicated macro. GCC
> just said "Parse error", which didn't help me much. In desperation I
> submitted the code to Turbo C, got a "Missing )" message, and had it
> fixed quickly. But that is less important.
"Parse error" means "Syntax error", that's all.
The degree to which a given parser can give you specific diagnostics on
syntax errors depends on how that parser was designed. It is sheer luck
to get a diagnostics such as "Missing )"; a sufficiently-complexx
expression that uses unbalanced parentheses will probably break that.
Many syntax errors leave the parser in an error state from which they
cannot second-guess what was the cause of the problem without a prolonged
analysis that would make the parse painfully slow.
On the other hand, you could always ask: if Turbo C is so smart, why
doesn't it just add that paren and compile the source anyway?
- Raw text -