Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!decuac!shlump.nac.dec.com!tkou02.enet.dec.com!diamond From: diamond@tkou02.enet.dec.com (diamond@tkovoa) Newsgroups: comp.std.c Subject: Re: X3J11 Pleasanton meeting summary Keywords: X3J11 Pleasanton meeting C standard interpretations Message-ID: <1990Oct19.000202.4393@tkou02.enet.dec.com> Date: 19 Oct 90 00:02:02 GMT References: <13996@smoke.BRL.MIL> <3427@mcrware.UUCP> Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 30 In article <3427@mcrware.UUCP> jejones@mcrware.UUCP (James Jones) writes: >In article <13996@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >> struct foo x; >> struct foo { int i; }; >> /* the above is strictly conforming; incomplete-type objects can >> be defined, so long as by the end of the translation unit the >> type becomes complete so that storage can then be allocated */ >If this is the current interpretation, then it is not consistent with the >"Semantics" portion of section 3.5 (lines 30-31, p.70), which states >"If an identifier for an object is declared with no linkage, the type >for the object shall be complete by the end of its declarator, or by >the end of its init-declarator if it has an initializer." If this declaration of x is not inside a function or struct, and if no other declaration of the same x is presently visible, then this declaration gives x external linkage. Presumably this has been the situation so far in this discussion. However, if this declaration ("struct foo x;") is inside a function (possibly inside a nested block), or inside a declaration of another struct, then this x (auto or struct member) has no linkage. Therefore it seems that Mr. Jones has proven the illegality of: struct foo; func() { struct foo x; } struct foo { int i; } likely to the relief of many compiler writers. -- Norman Diamond, Nihon DEC diamond@tkov50.enet.dec.com (tkou02 is scheduled for demolition) We steer like a sports car: I use opinions; the company uses the rack.