Messages in this thread | | | Date | Fri, 2 May 2008 15:33:06 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [PATCH] kernel/time.c: Silence gcc warning 'integer constant to large for long type' |
| |
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
| |