From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: [RFH] gcc constant expression warning... Date: Sun, 28 Oct 2007 01:46:47 -0700 Message-ID: <7vy7dnvd6w.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Oct 28 09:47:07 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Im3nV-0004r9-UT for gcvg-git-2@gmane.org; Sun, 28 Oct 2007 09:47:06 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751127AbXJ1Iqx (ORCPT ); Sun, 28 Oct 2007 04:46:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750978AbXJ1Iqx (ORCPT ); Sun, 28 Oct 2007 04:46:53 -0400 Received: from sceptre.pobox.com ([207.106.133.20]:45042 "EHLO sceptre.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbXJ1Iqw (ORCPT ); Sun, 28 Oct 2007 04:46:52 -0400 Received: from sceptre (localhost.localdomain [127.0.0.1]) by sceptre.pobox.com (Postfix) with ESMTP id 3A2762EF; Sun, 28 Oct 2007 04:47:13 -0400 (EDT) Received: from pobox.com (ip68-225-240-77.oc.oc.cox.net [68.225.240.77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sceptre.sasl.smtp.pobox.com (Postfix) with ESMTP id D986C8E8B3; Sun, 28 Oct 2007 04:47:11 -0400 (EDT) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: 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);