This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc-20001027: Funny handling of sizeof()
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc-20001027: Funny handling of sizeof()
- From: Horst von Brand <vonbrand at sleipnir dot valparaiso dot cl>
- Date: Sat, 28 Oct 2000 10:39:14 -0300
Linux, Red Hat 7, i686
The line below (distilled from a macro for computing alignment) gets the
anoying and useless warning:
/tmp/tst.c:1: warning: large integer implicitly truncated to unsigned type
This warning disappears if sizeof(long) (a constant) is replaced by 4 (the
same constant!), or if the result is used to initialize an unsigned int.
int i = (5 + 4 - 1) & ~(sizeof(long)-1);
--
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Vin~a del Mar, Chile +56 32 672616