[Bug objc/40864] Designated initializers for multi-dimensional arrays fail in Objective-C
--- Comment #2 from sergei dot yakovlev at gmail dot com 2009-12-29 22:22 --- @fxcoudert: This is not an enhancement, this is a bug. Objective-C is declared as a strict superset of C. Everything that works in C should work in Objective-C. In this case, it doesn't, which means it's a bug. -- sergei dot yakovlev at gmail dot com changed: What|Removed |Added Severity|enhancement |normal http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40864
[Bug objc/40864] New: Designated initializers for multi-dimensional arrays fail in Objective-C
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. $ gcc -x c - <<<"int main(){ int a[3][4] = {[1][2] = 5}; }" $ gcc -x objective-c - <<<"int main(){ int a[3][4] = {[1][2] = 5}; }" : In function 'main': :1: error: syntax error before ']' token $ -- Summary: Designated initializers for multi-dimensional arrays fail in Objective-C Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: objc AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sergei dot yakovlev at gmail dot com GCC build triplet: i686-apple-darwin9 GCC host triplet: i686-apple-darwin9 GCC target triplet: i686-apple-darwin9 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40864