lkml.org 
[lkml]   [1997]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Style question: comparison between signed and unsigned?
Date
From
> 
> 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);}}

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.090 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site