git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFH] gcc constant expression warning...

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2007, 08:46 UTC
Message-ID
<7vy7dnvd6w.fsf@gitster.siamese.dyndns.org>
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);
Next: Florian Weimer
Message 1 of 8 in “[RFH] gcc constant expression warning...”
  1. Junio C HamanoOct 28, 2007
  2. Florian WeimerOct 28, 2007
  3. Daniel BarkalowOct 28, 2007
  4. Antti-Juhani KaijanahoOct 28, 2007
  5. Linus TorvaldsOct 28, 2007
  6. Nicolas PitreOct 29, 2007
  7. Stephen RothwellOct 29, 2007
  8. Linus TorvaldsOct 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.