Is the following program conforming under C99?
#include <stdio.h>
typedef struct foo {
int bar;
int baz[];
} foo;
foo foos[]={
{ 1, {1,2,3} }
};
int main() {
return 0;
}
gcc -Wall -pedantic -std=c99 (3.3.3 for cygwin) accepts the program
without the declaration for the array of foo structs, but issues an
error about "initializa tion of a flexible array member in a nested
context" on the program above. Is it correct?
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
#include <stdio.h>
typedef struct foo {
int bar;
int baz[];
} foo;
foo foos[]={
{ 1, {1,2,3} }
};
int main() {
return 0;
}
gcc -Wall -pedantic -std=c99 (3.3.3 for cygwin) accepts the program
without the declaration for the array of foo structs, but issues an
error about "initializa tion of a flexible array member in a nested
context" on the program above. Is it correct?
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Comment