Re: When to emit diagnistics
- From: "Joachim Schmitz" <nospam.jojo@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 14 Jul 2008 09:14:48 +0200
jacob navia wrote:
Recently we had a discussion about the following code:Good. One problem solved. Now document that switch in your manual.
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?All valid points, indeed.
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 thisHaven't tested this myself, but a far as I understood others (namely RH), it
even with the highest warning level.
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 likeNobody claimed win-lcc to be useless. The only claim here (and plenty proof
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.
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
.
- References:
- When to emit diagnistics
- From: jacob navia
- When to emit diagnistics
- Prev by Date: Re: Commandline compiler for windows?
- Next by Date: Re: When to emit diagnistics
- Previous by thread: When to emit diagnistics
- Next by thread: Re: When to emit diagnistics
- Index(es):
Relevant Pages
|