From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21132 invoked by alias); 3 Jul 2005 00:20:33 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 21114 invoked by uid 22791); 3 Jul 2005 00:20:28 -0000 Received: from smtp-100-sunday.nerim.net (HELO kraid.nerim.net) (62.4.16.100) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 03 Jul 2005 00:20:28 +0000 Received: from uniton.integrable-solutions.net (gdr.net1.nerim.net [62.212.99.186]) by kraid.nerim.net (Postfix) with ESMTP id 395B540F5B; Sun, 3 Jul 2005 02:20:25 +0200 (CEST) Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j630JSKY026645; Sun, 3 Jul 2005 02:19:28 +0200 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.10/8.12.10/Submit) id j630JSlV026644; Sun, 3 Jul 2005 02:19:28 +0200 To: Joe Buck Cc: Robert Dewar , Daniel Berlin , Andrew Pinski , "'gcc mailing list'" Subject: Re: Should GCC publish a general rule/warning due to it's default presumption of undefined signed integer overflow semantics? References: <20050630232531.GA11010@synopsys.com> <20050701012538.GA11465@synopsys.com> <1120187757.17986.14.camel@linux-009002243055> <42C6C5E7.20005@adacore.com> <42C72005.1090900@adacore.com> <20050702232806.GA25239@synopsys.com> From: Gabriel Dos Reis In-Reply-To: <20050702232806.GA25239@synopsys.com> Date: Sun, 03 Jul 2005 00:20:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00081.txt.bz2 Joe Buck writes: | On Sat, Jul 02, 2005 at 07:15:17PM -0400, Robert Dewar wrote: | > Gabriel Dos Reis wrote: | > > | > > for (int i = min; i < max; ++i) | > > .... | > > | > >and i, min and max don't change in the body, no matter what you think | > >of C's general "for" not being a FOR loop, the above is a FOR loop. | > | > But this normal paradigm for representing a FOR loop does not work for | > all possible ranges, that's precisely the trouble! | | Yes, there's a problem if the maximum value of i is intended to be | INT_MAX. I don't think the cases of INT_MAX represents the majority of such FOR loop. The semi-open interval is a widespread idiom and has become a standard idiom, at least if you move to STL :-) -- Gaby