Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!know!newmedia!jim From: jim@newmedia.UUCP (Jim Beveridge) Newsgroups: comp.lang.c Subject: Undefined structures Message-ID: <442@newmedia.UUCP> Date: 4 Feb 91 16:52:10 GMT Organization: New Media Graphics, Billerica, MA Lines: 32 Microsoft C compiles the following program with no errors: extern int callvw(struct _vw_package *pack); main() { } I find this rather amazing considering that "struct _vw_package" is undefined. If I compile the program with gcc 1.37 under SunOS, I get this error: t.c:1: warning: `struct _vw_package' declared inside parameter list t.c:1: warning: its scope is only this definition or declaration, t.c:1: warning: which is probably not what you want. This would seem to imply that MSC v6 _might_ be doing the right thing by defining the structure for just inside the prototype. If I make the declaration, "struct junk *g;" after the extern above, it compiles correctly even though "struct junk" doesn't exist. What exactly is going on here: What is the scope of these declarations? How are these references being resolved? What is proper compiler behavior? Thanks, Jim