Re: kernel/time.c: integer constant is too large for long type

From: H. Peter Anvin
Date: Fri May 02 2008 - 00:34:57 EST


Carlos R. Mafra wrote:
Hi Peter,

I would like to report a gcc warning which caught my attention today:

kernel/time.c: In function msecs_to_jiffies:
kernel/time.c:479: warning: integer constant is too large for long type
kernel/time.c: In function usecs_to_jiffies:
kernel/time.c:494: warning: integer constant is too large for long type

and ask you if this is something I should worry about (and propose
a patch if this warning is harmless).

I ask this because this warning was introduced via commit bdc807871d58285737d50dc6163d0feb72cb0dc2 ("avoid overflows in kernel/time.c")
and (naively) for me it looks like the above gcc warning is some kind of overflow.


Hi there,

The code is correct if a bit subtle. I have put a fix of it as part of a larger patch series at:

git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-inttypes.git

Your patch is simpler, so if Linus doesn't take the patch series this window we should push your patch after the window closes.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/