When to emit diagnistics



Recently we had a discussion about the following code:

void f(long *lp) { *lp = 0; }
int main(void) { int i; f(&i); return i; }

lcc-win doesn't emit any diagnostic in normal mode, and doesn't
emit a diagnostic with the higher warning level.

It emits a diagnostic only in the highest warning level:

lcc -A -A foo.c

will diagnostic that with a warning.

Why?

Because under windows (32 and 64 bits) there is
absolutely no PRACTICAL difference between a
long and an int. They are completely equivalent types.

The diagnostic would just add CLUTTER and NOISE to
the output of the compiler.

The problem is that if the compiler emits too many diagnostics
the important ones will go unnoticed, swallowed by the noise
of the unimportant ones.

Note that Microsoft C, for instance will not diagnose this
even with the highest warning level.

This are the reasons behind the decision. Some people like
heathfield or becarisse use this as a "proof that lcc-win is
useless", etc. Their usual stuff. Note that lcc-win is not
just for pleasing pedants in comp.lang.c but it is useful
for doing REAL work. The objective is not to please
pedants here.


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



Relevant Pages

  • Re: When to emit diagnistics
    ... emit a diagnostic with the higher warning level. ... It emits a diagnostic only in the highest warning level: ... You are assuming here that any Standard C program compiled with lcc-win ... IME Intel's compiler has somewhat better diagnostics than even gcc. ...
    (comp.lang.c)
  • Re: When to emit diagnistics
    ... lcc-win doesn't emit any diagnostic in normal mode, ... emit a diagnostic with the higher warning level. ... It emits a diagnostic only in the highest warning level: ... The problem is that if the compiler emits too many diagnostics ...
    (comp.lang.c)
  • Re: When to emit diagnistics
    ... emit a diagnostic with the higher warning level. ... It emits a diagnostic only in the highest warning level: ... the output of the compiler. ... The problem is that if the compiler emits too many diagnostics ...
    (comp.lang.c)
  • Re: When to emit diagnistics
    ... emit a diagnostic with the higher warning level. ... It emits a diagnostic only in the highest warning level: ... for instance will not diagnose this ... you replied "and lcc-win also", in an article timestamped 12 minutes or so ...
    (comp.lang.c)
  • Re: A good compiler
    ... That's just your opinion. ... to emit as many diagnostics as they deem fit, ... that emits diagnostics with valid code is screwed up. ... 'C' - this is a Fortran comment indicator, ...
    (comp.lang.c)