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@xxxxxxxxxxxxxxxx :: http://www.planetfall.pwp.blueyonder.co.uk