When to emit diagnistics
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Mon, 14 Jul 2008 09:02:21 +0200
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
.
- Follow-Ups:
- Re: When to emit diagnistics
- From: lawrence . jones
- Re: When to emit diagnistics
- From: Ben Bacarisse
- Re: When to emit diagnistics
- From: Kenneth Brody
- Re: When to emit diagnistics
- From: Eric Sosman
- Re: When to emit diagnistics
- From: Spiro Trikaliotis
- Re: When to emit diagnistics
- From: Keith Thompson
- Re: When to emit diagnistics
- From: Richard Heathfield
- Re: When to emit diagnistics
- From: Ian Collins
- Re: When to emit diagnistics
- From: santosh
- Re: When to emit diagnistics
- From: Joachim Schmitz
- Re: When to emit diagnistics
- Prev by Date: Re: Commandline compiler for windows?
- Next by Date: Re: Commandline compiler for windows?
- Previous by thread: Exercise 5-14
- Next by thread: Re: When to emit diagnistics
- Index(es):
Relevant Pages
|