This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc-20001027: Funny handling of sizeof()


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]