From: Nicolas Pitre Date: Mon, 29 Oct 2007 00:55:32 GMT Subject: Re: [RFH] gcc constant expression warning... Message-ID: In-Reply-To: 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