🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2847

Re: Pointers to Incomplete Types in Prototypes

#2847
From: Robert Elz
Date: Sat, 04 May 1991 05:20
33 lines
1522 bytes
Disclaimer: I know absolutely nothing about ANSI C ...

I can't see how its possible for

	type foo(struct bar *arg);

to possibly be considered as any kind of a definition of the
struct tag "bar".  Whether "bar" is defined elsewhere or not,
this is (and can only be) a reference to "bar".

Struct tags are (should be, surely) only defined in a context
as

	struct bar { ... };

The question of the scope inside the function prototype can only
possibly be relevant to names defined there, of which "bar" is not
one in the above example.  It would be in

	type foo(struct bar { ... } *arg);

which would *always* be a meaningless prototype, regardless of
whether bar was defined elsewhere or not.

It seems as if the compiler involved is treating the reference
to bar in the first prototype above as a definition, as it hadn't
seen a definition before.  That is surely a bug.

Would all those people who have blindly been quoting the standard
on these issue please turn to the paragraph that defines struct
tag definition, and please quote form there as well.

kre
Technical Details
Message-ID: <kre.673334440@mundamutti.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!cs.mu.OZ.AU!kre
References: <w!2g7+c@rpi.edu> <700@taumet.com> <cl3gg!n@rpi.edu> <683g+p#@rpi.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!cs.mu.OZ.AU!kre
From: kre@cs.mu.oz.au (Robert Elz)
Newsgroups: comp.std.c
Subject: Re: Pointers to Incomplete Types in Prototypes
Message-ID: <kre.673334440@mundamutti.cs.mu.OZ.AU>
Date: 4 May 91 05:20:40 GMT
References: <w!2g7+c@rpi.edu> <700@taumet.com> <cl3gg!n@rpi.edu> <683g+p#@rpi.edu>
Sender: news@cs.mu.oz.au
Lines: 33