Subject: Re: archive.c/arm32
To: Chris G. Demetriou <cgd@pa.dec.com>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: current-users
Date: 03/23/1998 22:58:09
> ((int)val >= 0) yields the correct result, but also causes that
> warning.
a-HA. Granted, a compiler is entitled to emit as many spurious messages
as it likes, but this seems too clever by half...
> (((int)val & 0x100) == 0) also yields the correct result (for machines
> where char is 8 bits -- i.e. all machines that NetBSD supports), but
> does not cause that warning. The expression is still always true on
> unsigned-char machines, but gcc isn't sophisticated enough to catch it.
^^^^^^^^^^^^^
To quote Rob Pike, "The technical term for that is ``brain damaged''."
*NOW* I understand. "Never mind."
(One suggestion though: add a comment to the code.)