🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4033

Re: Function-prototype scope: Why?

#4033
From: Paul Long
Date: Mon, 18 Sep 1995 17:44
23 lines
1733 bytes
kanze@gabi-soft.fr (J. Kanze) wrote:
>I *think* that the rationale for disallowing defining new types in
>function prototypes is that there is no way to use such types.

Right, that's my point.  Other than within the prototype, the new type
cannot be referrenced. It's practically useless.

>In C++
>(which uses name equivalence), there is in fact no way to even call the
>function (since the function must be called with a type whose scope ends
>at the end of the function prototype).  In C, if I'm not mistaken, it
>should be possible to declare an exactly equivalent type outside the
>function prototype, and use it, although I imagine that this would be
>very error prone.

I believe that you are mistaken. The two structures would be different even if
they were compatible and had the same tag.

-- 
Paul Long                               45:29:14N 122:48:09W
plong@perf.com                          http://www.teleport.com/~pciwww/
    "Where time or intelligence are lacking, a goto may do the job."
        - M.E. Hopkins, "A Case for the GOTO," 1972.
Technical Details
Message-ID: <43kb6s$ntr@news0.rain.rg.net>
Path: arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenet
References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> <43j9oo$62d@gabi.gabi-soft.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenet
From: Paul Long <plong@perf.com>
Newsgroups: comp.std.c
Subject: Re: Function-prototype scope: Why?
Date: 18 Sep 1995 17:44:59 GMT
Organization: Performance Computing Incorporated
Message-ID: <43kb6s$ntr@news0.rain.rg.net>
References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> <43j9oo$62d@gabi.gabi-soft.fr>
NNTP-Posting-Host: yosemite.perf.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.1 sun4c)
X-URL: news:43j9oo$62d@gabi.gabi-soft.fr