lkml.org 
[lkml]   [2008]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-05-03 00:35    [W:0.052 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site