Flexible size array
- From: Christopher Benson-Manica <ataru@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 23:13:32 +0000 (UTC)
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 "initialization 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)cyberspace.org | don't, I need to know. Flames welcome.
.
- Follow-Ups:
- Re: Flexible size array
- From: Robert Gamble
- Re: Flexible size array
- Prev by Date: Re: Paasing global variables to functions
- Next by Date: Re: Paasing global variables to functions
- Previous by thread: padding a file
- Next by thread: Re: Flexible size array
- Index(es):
Relevant Pages
|