This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Chill warning questions #2
- To: Joe Buck <jbuck at synopsys dot com>
- Subject: Re: Chill warning questions #2
- From: Per Bothner <bothner at cygnus dot com>
- Date: Thu, 15 Oct 1998 09:52:50 -0700
- cc: egcs at cygnus dot com
[Context: (signed char) (-1) == (unsigned char) 0xFF]
> This will only surprise those unfamiliar with 2's complement. I don't
> think the warning is worth it even in this case.
Not at all. I, who am very familiar with 2's complement, can see two
reasonable definitions:
(1) The arguments are compared as is using 8-bit compare.
The values are equal.
(2) The arguments are extended to int. The values are un-equal.
Without having actually checked, I would guess the standard says (2).
But the point is I'm not sure, and it is not unreasonable to
expect either.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner