sizetype overflow?
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Tue Nov 14 02:32:00 GMT 2000
What is the purpose of the following patch?
Fri Oct 20 13:33:16 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* fold-const.c (force_fit_type): Unsigned values can overflow
if they are sizetype.
As far as I can tell, all it does is break the following test:
To make sure that we correctly give an overflow in all cases where an object's
size is too large. This is required, for example, in Ada.
unsigned long foo(void)
{
return ~(sizeof(long)-1);
}
$ ./cc1 -quiet -W zz.c
zz.c: In function `foo':
zz.c:3: warning: large integer implicitly truncated to unsigned type
Perhaps C should do the same as C++, where the user-visible sizetype is
not the internal sizetype?
More information about the Gcc-bugs
mailing list