Re: [PATCH] kernel/time.c: Silence gcc warning 'integer constant tolarge for long type'

From: Linus Torvalds
Date: Fri May 02 2008 - 18:33:47 EST




On Fri, 2 May 2008, Linus Torvalds wrote:
>
> The thing is, if C code needs to do
>
> U64_C(HZ_TO_USEC_MUL32)
>
> to use the macro HZ_TO_USEC_MUL32, then that is a *bug* in the macro.

Ok, it seems worse than that. I don't see the point of that U64_C thing at
all.

Those macros are only used in C code.

The values should have the right C types already (ie "ull" at the end of
big constants to make sure we don't trigger warnings). And no, we do NOT
want to have 5 different macro names for five different versions of the
same macro. That's just insane.

Make the timeconst.h file just contain sane macros. No preprocessor games
etc. Just make it say

#define USEC_TO_HZ_MUL32 ..correct-value-here..

and not even generate macros with values that cannot be used (ie >64
bits).

Linus
--
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/