From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26458 invoked by alias); 22 Jun 2012 19:02:56 -0000 Received: (qmail 26444 invoked by uid 22791); 22 Jun 2012 19:02:55 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jun 2012 19:02:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CA3331C7322; Fri, 22 Jun 2012 15:02:35 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ECJBuqCBn8ZM; Fri, 22 Jun 2012 15:02:35 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 77DA01C72C2; Fri, 22 Jun 2012 15:02:35 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7407B145616; Fri, 22 Jun 2012 12:02:28 -0700 (PDT) Date: Fri, 22 Jun 2012 19:02:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Mark Kettenis , dje@google.com, pierre.muller@ics-cnrs.unistra.fr, gdb-patches@sourceware.org Subject: Re: New ARI warning Wed May 23 01:55:03 UTC 2012 Message-ID: <20120622190228.GM2799@adacore.com> References: <4fbc9d77.0853b40a.641e.ffff90dbSMTPIN_ADDED@mx.google.com> <87bold8l4d.fsf@fleche.redhat.com> <201205282043.q4SKhksB010254@glazunov.sibelius.xs4all.nl> <87ipejib8o.fsf@fleche.redhat.com> <20120622171922.GK2799@adacore.com> <20120622173049.GL2799@adacore.com> <877guzgs7r.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877guzgs7r.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00729.txt.bz2 > >> * configure.ac (build_warnings): Add -Wdeclaration-after-statement. > >> * configure: Regenerate. > > Yes, ok. Thanks; I hadn't realized there was a flag for this already :) Thanks, checked in. > Discussion on irc pointed out that this is still allowed: > > for (int i = 0; ...) > > I think this doesn't suffer from the readability problems that > declarations in the code generally do; and in fact usually makes the > code cleaner, by restricting the scope of the loop variable. Agreed. Note that this is only going to be accepted if we compile in C99 mode, I think. Otherwise, you'll get a warning which is unrelated declarations being used after statements. error: 'for' loop initial declarations are only allowed in C99 mode > How about we flip the switch to C99 for 7.6? Sounds good to me. Do we want to be exclusive, rather than inclusive? In other words, say: The following C99 constructs are allowed, and maintain that list, rather that allow all of C99, and then list the features not allowed. I understand that some features are still not implemented (or portable?). -- Joel