git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Antti-Juhani Kaijanaho <antti-juhani@kaijanaho.fi>, git@vger.kernel.org
Subject: Re: [RFH] gcc constant expression warning...
Date: Sun, 28 Oct 2007 20:55:32 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.0.9999.0710282053590.22100@xanadu.home> (raw)
In-Reply-To: <alpine.LFD.0.999.0710281000260.30120@woody.linux-foundation.org>

On Sun, 28 Oct 2007, Linus Torvalds wrote:

> 
> 
> On Sun, 28 Oct 2007, Antti-Juhani Kaijanaho wrote:
> >
> > A correct fix would be to check for the size of off_t in some other (and
> > defined) manner, but I don't know off_t well enough to suggest one.
> 
> In this case, it's trying to make sense that "off_t" can hold more than 32
> bits. So I think that test can just be rewritten as
> 
> 	if (sizeof(off_t) <= 4) {
> 		munmap(idx_map, idx_size);
> 		return error("pack too large for current definition of off_t in %s", path);
> 	}
> 
> instead.

The test must also make sure off_t isn't signed, since in that case it 
can only hold 31 bits.


Nicolas

  reply	other threads:[~2007-10-29  0:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-28  8:46 [RFH] gcc constant expression warning Junio C Hamano
2007-10-28 10:21 ` Florian Weimer
2007-10-28 16:28   ` Daniel Barkalow
2007-10-28 10:37 ` Antti-Juhani Kaijanaho
2007-10-28 17:09   ` Linus Torvalds
2007-10-29  0:55     ` Nicolas Pitre [this message]
2007-10-29  2:41       ` Stephen Rothwell
2007-10-29  4:37       ` Linus Torvalds

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=alpine.LFD.0.9999.0710282053590.22100@xanadu.home \
    --to=nico@cam.org \
    --cc=antti-juhani@kaijanaho.fi \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).