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.

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.

But they are incompatible types. I thought you'd made a Linux port of
the compiler? There you would have an issue.

Both Sun cc and gcc warn on their default settings.

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.

Most shops have a "no warnings in the build" rule for that very reason.
It isn't hard to do.

--
Ian Collins.
.



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: 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)
  • Re: The Psychology of Responding to Crackpots
    ... > The program is required to emit at least one ... > disgnostic for every program that hangs, ... KB of diagnostics for every program. ... that is flawless is analyzed as to exactly why it is ...
    (sci.logic)
  • 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)
  • 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)