[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0805021528080.5994@woody.linux-foundation.org>
Date: Fri, 2 May 2008 15:33:06 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "H. Peter Anvin" <hpa@...or.com>
cc: "Carlos R. Mafra" <crmafra@....unesp.br>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists