This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc brace enclosed initializer problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]