This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: sizeof() function result tests < -1
- To: Richard Sharman <richard_sharman at Mitel dot COM>
- Subject: Re: sizeof() function result tests < -1
- From: Horst von Brand <vonbrand at sleipnir dot valparaiso dot cl>
- Date: Sat, 08 Jan 2000 00:34:42 -0300
- cc: bug-gcc at gnu dot org
Richard Sharman <richard_sharman@Mitel.COM> said:
> On a sparc and a 386, although sizeof(int) returns 4 when used in an
> assignment, the test sizeof(int) < -1 returns true.
sizeof returns an unsigned, and -1 is cast to that for the < ...
--
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile +56 32 672616