G
Grumble
Hello,
Is it not legal in C90 to initialize a multi-dimensional array with a
one-dimensional initializer as done below?
int a[2][2][2] = { 1, 2, 3, 4, 5, 6, 7, 8 };
My compiler complains:
example.c:1: warning: missing braces around initializer
example.c:1: warning: (near initialization for `a[0]')
On a somewhat related note, are compilers free to emit warnings, even
if the program is correct?
Nudge
Is it not legal in C90 to initialize a multi-dimensional array with a
one-dimensional initializer as done below?
int a[2][2][2] = { 1, 2, 3, 4, 5, 6, 7, 8 };
My compiler complains:
example.c:1: warning: missing braces around initializer
example.c:1: warning: (near initialization for `a[0]')
On a somewhat related note, are compilers free to emit warnings, even
if the program is correct?
Nudge