------- Comment #1 from joseph at codesourcery dot com 2009-07-26 21:43 ------- Subject: Re: New: Designated initializers for multi-dimensional arrays fail in Objective-C
On Sun, 26 Jul 2009, sergei dot yakovlev at gmail dot com wrote: > Designated initializers for multi-dimensional arrays work great in C (C99), > but > fail in Objective-C (see example below). Given that Objective-C is proclaimed > a > strict superset of C, I consider this a bug. This was a property of the old C parser I carefully replicated when writing the new one. I do not know if there exists a C99-based specification of ObjC that clarifies what is intended (and note that this interacts with the old GNU form of designated initializers as well); I took it as given by the implementation at that time. /* ??? Following the old parser, [ objc-receiver objc-message-args ] is accepted as an initializer, being distinguished from a designator by what follows the first assignment expression inside the square brackets, but after a first array designator a subsequent square bracket is for Objective-C taken to start an expression, using the obsolete form of designated initializer without '=', rather than possibly being a second level of designation: in LALR terms, the '[' is shifted rather than reducing designator to designator-list. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40864