From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9790 invoked by alias); 3 Feb 2004 00:35:56 -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 9783 invoked from network); 3 Feb 2004 00:35:56 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 3 Feb 2004 00:35:56 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AnoXe-0007m1-TX; Mon, 02 Feb 2004 19:35:50 -0500 Date: Tue, 03 Feb 2004 00:35:00 -0000 From: Daniel Jacobowitz To: Mike Stump Cc: Joe Buck , Diego Novillo , Syd Polk , GCC List Subject: Re: Help restricting args of an intrinsic function Message-ID: <20040203003550.GA23732@nevyn.them.org> Mail-Followup-To: Mike Stump , Joe Buck , Diego Novillo , Syd Polk , GCC List References: <20040202154505.A8355@synopsys.com> <4DCDEE53-55E0-11D8-A1BE-003065A77310@apple.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DCDEE53-55E0-11D8-A1BE-003065A77310@apple.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-02/txt/msg00144.txt.bz2 On Mon, Feb 02, 2004 at 04:31:27PM -0800, Mike Stump wrote: > On Monday, February 2, 2004, at 03:45 PM, Joe Buck wrote: > >So issue a warning, and make the warning suppressible. If you don't, > >you'll then be in the position of telling people to use #define instead > >of const, > > ? I don't see that that follows. Syd intends on making const int i = > 5 work. If he does that, then there is not need to tell people to use > #define instead of const int i = 5. > > >and you'll saddle us with a huge stream of additional bugs > >(any time the compiler changes in such a way that an expression that > >used to be simplified to a constant at -O0 isn't, we get a bug report). > > Again, I don't see that this follows: > > const int ci = 5; > class A { > public: > static const int sci = 5; > static char a1[sci]; > } a; > > char A::a1[sci]; > > int a1[ci]; > int a2[A::sci]; > > is valid code that already must work, and work is defined to be knowing > that size of the arrays at compile time. > > Syd needs nothing more. Since this is already implemented, already > works, and already is maintained, I don't see this as a maintenance > burden. The only issue is how best to hook into it. If you read Richard's reply, he says that will already work - in C++. In C, const int ci = 5; int a1[ci]; will not compile, because ci is not an integral constant-expression. If Syd is trying to make that work in C/ObjC, as opposed to C++, some serious surgery may be involved. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer