Messages in this thread | | | Subject | Re: Style question: comparison between signed and unsigned? | Date | Thu, 25 Sep 1997 13:07:23 +0200 (METDST) | From | (Rogier Wolff) |
| |
> > Ulrich Drepper wrote: > > For glibc we had to fix around >1000 files. > > That's impressive. And how many bugs did you discover in the process ? > > BTW, I agree that requiring many extra casts is a bad idea, because > there's no way of telling if a cast is only intended to emphasize > default semantics or if it should also twist the type compatibility. > > I also note that gcc occasionally gets into the habit of encouraging > a certain syntax, e.g. the use of parentheses when mixing &&, ||,
I'm told (long time ago) that some compilers had the precedence rules the wrong way around. So your software would behave wrong unexpectedly when compiled with one of those.
> etc. (a good move, IMHO), or the use of parentheses around assignments > in if, while, and such (annoying, IMHO).
My experience is that for me "it is a type" about half of the times. I want the compiler to warn me about it, even if I get 90% false alerts.
Simply because it is more than 10 times harder to find a runtime bug than a compiler warning (which gives you the line number and the source file).
Roger.
-- /* EMail: R.E.Wolff@BitWizard.nl */ int main (int argc,char**argv){ /* Tel: +31-15-2137459 */ if (*++argv&&!strcmp(*argv,"-advice")) /* WWW: http://www.BitWizard.nl/ */ {printf("Don't Panic!\n");exit(42);}}
| |