git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFH] gcc constant expression warning...
@ 2007-10-28  8:46 Junio C Hamano
  2007-10-28 10:21 ` Florian Weimer
  2007-10-28 10:37 ` Antti-Juhani Kaijanaho
  0 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2007-10-28  8:46 UTC (permalink / raw)
  To: git

With the recent gcc, we get:

sha1_file.c: In check_packed_git_:
sha1_file.c:527: warning: assuming signed overflow does not
occur when assuming that (X + c) < X is always false
sha1_file.c:527: warning: assuming signed overflow does not
occur when assuming that (X + c) < X is always false

when compiling with

    -O2 -Werror -Wall -Wold-style-definition \
    -ansi -pedantic -std=c99 -Wdeclaration-after-statement

The offending lines are:

        if (idx_size != min_size) {
                /* make sure we can deal with large pack offsets */
                off_t x = 0x7fffffffUL, y = 0xffffffffUL;
                if (x > (x + 1) || y > (y + 1)) {
                        munmap(idx_map, idx_size);

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-10-29  4:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2007-10-29  2:41       ` Stephen Rothwell
2007-10-29  4:37       ` Linus Torvalds

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).