From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30074 invoked by alias); 6 Dec 2004 19:14:17 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29816 invoked from network); 6 Dec 2004 19:14:11 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 6 Dec 2004 19:14:11 -0000 Received: (qmail 14166 invoked from network); 6 Dec 2004 19:14:10 -0000 Received: from localhost (HELO ?192.168.189.167?) (nathan@127.0.0.1) by mail.codesourcery.com with SMTP; 6 Dec 2004 19:14:10 -0000 Message-ID: <41B4AF79.4010408@codesourcery.com> Date: Mon, 06 Dec 2004 19:14:00 -0000 From: Nathan Sidwell Organization: Codesourcery LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 MIME-Version: 1.0 To: Jack Marr CC: gcc-help@gcc.gnu.org Subject: Re: gcc brace enclosed initializer problem References: <41B4A981.2020309@ugs.com> In-Reply-To: <41B4A981.2020309@ugs.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00061.txt.bz2 Jack Marr wrote: > We acknowledge that the braces are not needed, but it's not apparent why > this should be an *error* rather than a mere warning as it is when the > same code is compiled with gcc. We've squinted at ISO 14882 section > 8.5.1 (dcl.init.aggr), but haven't seen why this should be an *error*. I > understand that gcc/g++ is sometimes more standards compliant than other > compilers, but we're not sure if this is the case here, and thought this > might actually be a g++ bug. it is an error. EDG 3.4 rejects the code in strict mode, but gives warnings in non-strict mode. 8.5.1/2 applies recursively to give '{"how now"}' as an initializer for a 'char const *' object. 8.5 does not give it as a valid initializer form. The nearest one gets is /13 which allows an extra set at the top level. If you feel strongly, submit a bug report. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk