X3J11 Pleasanton meeting summary

diamond@tkovoa diamond at tkou02.enet.dec.com
Fri Oct 19 10:02:02 AEST 1990


In article <3427 at mcrware.UUCP> jejones at mcrware.UUCP (James Jones) writes:
>In article <13996 at smoke.BRL.MIL> gwyn at 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 at tkov50.enet.dec.com
                                    (tkou02 is scheduled for demolition)
We steer like a sports car:  I use opinions; the company uses the rack.



More information about the Comp.std.c mailing list