Skip to contentSkip to conversation

sparse considers LONG_MAX too big for long on x86-64

DISCUSSION Josh Triplett 1 participant 1 message Aug 25, 2011 Sparse checker

lore
Share & tools
lore
#0 lore raw

sizeof(long) == 8 on x86-64, but sparse thinks LONG_MAX needs a long long:

/tmp$ uname -a
Linux leaf 3.0.0-1-amd64 #1 SMP Wed Aug 17 04:08:52 UTC 2011 x86_64 GNU/Linux /tmp$ cat test.c
#include <limits.h>
#if LONG_MAX < 0
#endif
/tmp$ sparse test.c
test.c:2:5: warning: constant 9223372036854775807L is so big it is long long /tmp$ cgcc -c test.c -o /dev/null
test.c:2:5: warning: constant 9223372036854775807L is so big it is long long /tmp$ echo $((2**63 - 1))
9223372036854775807

- Josh Triplett