public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Johann Felix Soden <johfel@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] time: Fix constant size in kernel/timeconst.h
Date: Sat, 09 Feb 2008 13:33:19 -0800	[thread overview]
Message-ID: <47AE1C1F.2070304@zytor.com> (raw)
In-Reply-To: <1202563242.22512.1.camel@localhost>

Johann Felix Soden wrote:
> From: Johann Felix Soden <johfel@users.sourceforge.net>
> 
> kernel/timeconst.pl generates only long sized constants in timeconst.pl
> which gives this warning:
> 
> kernel/time.c: In function 'msecs_to_jiffies':
> kernel/time.c:472: warning: integer constant is too large for 'long' type
> 
> unsigned long long is needed.
> 

Hm, you've just taken a warning and elevated it to a bug.

According to the C standard, a constant has the shortest type (>= int) 
needed to hold the constant, and the warning above is somewhat bogus in 
that context (what version of gcc is that, anyway?)

ULL is only appropriate to 32-bit machines, or there will be other 
issues downstream.  The Right Way[TM] to do this would be to get Linux 
to have the [U]INTxx_C() macros from C99.

	-hpa


  reply	other threads:[~2008-02-09 21:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 13:20 [PATCH] time: Fix constant size in kernel/timeconst.h Johann Felix Soden
2008-02-09 21:33 ` H. Peter Anvin [this message]
2008-02-09 22:29   ` Johann Felix Soden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AE1C1F.2070304@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=johfel@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox