Re: When to emit diagnistics



jacob navia wrote:
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.
Good. One problem solved. Now document that switch in your manual.

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.
All valid points, indeed.

Note that Microsoft C, for instance will not diagnose this
even with the highest warning level.
Haven't tested this myself, but a far as I understood others (namely RH), it
it does diagnose this if called _in conforming mode_. So please don't
continue comparing apples with peaches.

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.
Nobody claimed win-lcc to be useless. The only claim here (and plenty proof
for it) was that win-lcc does not (unlike your claim) conform to either
C89/C90 or C99.
So it is a compiler for a C-like language, no more, no less. That doesn't
make it useless.

Bye, Jojo


.



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)
  • 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)