Pointers to Incomplete Types in Prototypes

Doug Gwyn gwyn at smoke.brl.mil
Sat May 11 09:51:51 AEST 1991


In article <1991May10.011038.6781 at tkou02.enet.dec.com> diamond at jit533.enet@tkou02.enet.dec.com (Norman Diamond) writes:
>The problem, as someone else pointed out, is that struct 'bar'
>IS NOT DECLARED in the parameter list.  It is REFERENCED in the
>parameter list.

No, you're making distinctions of your own that the standard does not
support.  Use of "bar" in that context certainly does declare an
identifier "bar" to be a structure tag, according to the syntax of
section 3.5.2.1, which is a subset of the declaration syntax.  A
structure can be declared (incompletely or completely) "in passing"
within a "fatter" declaration; note the use of the plural for "entities",
"declarators", and "identfiers" in the second paragraph of 3.5 Semantics.

Absence of the "{ struct-declaration-list }" portion in the syntactic form
used in the source code merely means that the third paragraph in the
Semantics subsection is not relevant.  It does not mean that the
declaration does NOT declare a new type; that would be asserting the
converse, which is a logical fallacy.



More information about the Comp.std.c mailing list