From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27043 invoked by alias); 3 Feb 2004 01:16:24 -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 27034 invoked from network); 3 Feb 2004 01:16:23 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sources.redhat.com with SMTP; 3 Feb 2004 01:16:23 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out3.apple.com (8.12.10/8.12.11) with ESMTP id i131GNBv017101 for ; Mon, 2 Feb 2004 17:16:23 -0800 (PST) Received: from relay3.apple.com (relay3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.6) with ESMTP id ; Mon, 2 Feb 2004 17:16:23 -0800 Received: from apple.com (mrs1.apple.com [17.201.24.248]) by relay3.apple.com (8.12.9/8.12.11) with ESMTP id i131GF6I015816; Tue, 3 Feb 2004 01:16:15 GMT Date: Tue, 03 Feb 2004 01:16:00 -0000 Subject: Re: Help restricting args of an intrinsic function Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: Joe Buck , Diego Novillo , Syd Polk , GCC List To: Daniel Jacobowitz From: Mike Stump In-Reply-To: <20040203003550.GA23732@nevyn.them.org> Message-Id: <8F2CC706-55E6-11D8-A1BE-003065A77310@apple.com> Content-Transfer-Encoding: 7bit X-SW-Source: 2004-02/txt/msg00148.txt.bz2 On Monday, February 2, 2004, at 04:35 PM, Daniel Jacobowitz wrote: > 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. I know. But, one of the main reasons why we are introducing builtins is to be able to compile code from another compiler, Code Warrior. We are doing this so that users have an easy code migration. They allow it. Also, telling users that their code doesn't work in C, but works in C++ in this one case, is, uhm, pedantic. Does anyone know why the above isn't supported in C? Certainly the obviousness of it escapes me. My inclination is to fix the standard, not the compiler. > If Syd is trying to make that work in C/ObjC, as opposed to C++, some > serious surgery may be involved. I'm envisioning 6 lines of code. I can't fathom what could possible require major surgery.