Re: Why C/C++ errors are SO obscure/devious??



In article <IM%Qe.120733$fm.7885188@xxxxxxxxxxxx>,
Massimo Soricetti <massimo_main@xxxxxxxxxxx> wrote:

> [wants a more helpful compiler]

There have been compilers like this, though I haven't seen one for C.

The most famous example was PLICC, the IBM PL/1 Checkout Compiler.
It would insert semicolons, guess at missing declarations, and so on.
It could take a FORTRAN program and "fix" it until it was a legal PL/1
program (not all FORTRAN programs of course, but sufficiently simple
ones).

It worked quite well for users who were writing simple programs and whose
errors were ones of the kind it could fix - simple syntax errors and the
like.

As I remember, experienced users didn't use it much, and those who did
didn't generally let it fix the errors itself.

There's no need for such a program to be a real compiler (that is, one
that generates code). It can be a checker that you run separately or
that some other compiler runs for you when there's an error. The
traditional C tool "lint" was a bit like this: it did't fix your
files, but it attempted to do more comprehensive checking of your code
than most compilers did.

-- Richard
.



Relevant Pages

  • Re: STM32 ARM toolset advice?
    ... Compulsory car comparison: would you buy a car where the motor block is ... you yourself using a self-help book) can fix? ... compilers work better than a compiler vendor. ...
    (comp.arch.embedded)
  • Re: How many bytes per Italian character?
    ... There's a reason I don't use free open-source products: ... someone once said "Well, you should use gcc because that way, if you find a bug ... I used to work for a compiler company. ... *know* how hard it is to fix bugs in optimizing compilers. ...
    (microsoft.public.vc.mfc)
  • Re: "no variable or argument declarations are necessary."
    ... > say I write some Python code, using assert to validate datatypes. ... I fix the first error, ... I can often run 4 Python edit-debug cycles in the time it takes me to ... I'll spend more time making the compiler happy than the ...
    (comp.lang.python)
  • Re: size_t problems
    ... You really should bite the bullet and fix the code. ... Believe me, I know what porting means, what is important in code ... software package supplied by the vender is *full* of pre C89 crud. ... The compiler would yell at me. ...
    (comp.lang.c)
  • Re: Heres a good one...
    ... Fix it, recompile and follow ... Always look at the earliest diagnostic reported by the compiler. ... Anything following a syntax error can probably be ignored; ... Error messages up to and including the first reported syntax error are ...
    (comp.lang.c)