S
Suman
Let us take the sample code below:
/* start of translation unit */
struct foo {
int datum;
struct foo *link;
};
static struct foo bar; /* declare bar to have internal linkage and
static duration */
static struct foo baz; /* ditto, for baz */
static struct foo bar = { 42, &baz }; /* another _valid_ declaration
for bar */
static struct foo baz = { 24, &bar }; /* ditto for baz */
int main() {
}
/* end of translation unit, what happens here? */
This compiles fine with Comeau (in both C99 andC89/90 mode). I am
aware of
the static initialization order fiasco. Is that what is going on?
Regards,
Suman
/* start of translation unit */
struct foo {
int datum;
struct foo *link;
};
static struct foo bar; /* declare bar to have internal linkage and
static duration */
static struct foo baz; /* ditto, for baz */
static struct foo bar = { 42, &baz }; /* another _valid_ declaration
for bar */
static struct foo baz = { 24, &bar }; /* ditto for baz */
int main() {
}
/* end of translation unit, what happens here? */
This compiles fine with Comeau (in both C99 andC89/90 mode). I am
aware of
the static initialization order fiasco. Is that what is going on?
Regards,
Suman