This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc brace enclosed initializer problem
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Jack Marr <marr at ugs dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 06 Dec 2004 19:14:01 +0000
- Subject: Re: gcc brace enclosed initializer problem
- Organization: Codesourcery LLC
- References: <41B4A981.2020309@ugs.com>
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