Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!uupsi!njin!rutgers!att!dptg!ulysses!granjon!jhpb From: jhpb@granjon.UUCP (Joseph H. Buehler) Newsgroups: comp.lang.c Subject: initializing static mutually referencing structures Message-ID: <1287@granjon.UUCP> Date: 17 Sep 90 16:32:47 GMT Reply-To: jhpb@granjon.att.com (01000-JH Buehler(BLU123)) Distribution: usa Organization: AT&T Bell Laboratories, Liberty Corner Lines: 29 I have some structures that refer to each other, that I want to be static. The compiler doesn't like the following because it doesn't know what y is when it's initializing x: static struct xtag x = { &y; }; static struct ytag y = { &x; }; Does ANSI C have any way to do this? For now, I had to drop the static and put an extern at the top of the file: extern struct ytag y; struct xtag x = { &y; }; struct ytag y = { &x; }; Which is OK, I guess, but the structures really don't need global accessibility. -- Joe Buehler