On Mon, 21 Feb 2005, Hrvoje Niksic wrote:

> >> Agreed, in some cases.  In others it yields to pretty annoying
> >> compiler warnings.
> >
> >  What kind of warnings?
> 
> Comparing constants.  Unreachable code.

 Broken compiler?  What ends up as constants may be "computed" by cpp and 
depending on options and platform specifics need not always be constant.  
How is it expected to be "fixed"?  Besides, despite "sizeof(foo)" being a 
constant, you can't move a comparison against it to cpp.

> > It's valid C.
> 
> Never said it wasn't -- those are warnings, not errors.

 Unjustified, unless perhaps for debugging the compiler itself.  It could 
equally well complain about int-type constants used to initialize "long 
int" variables...  I'd suggest adding an autoconf test to disable such 
useless warnings.

  Maciej

Reply via email to