🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4046

Re: Function-prototype scope: Why?

#4046
From: Christopher R. Volpe
Date: Tue, 19 Sep 1995 15:34
54 lines
2202 bytes
In article <43l3er$rp@caip.rutgers.edu>, halasz@caip.rutgers.edu writes:
>In article <43i723$j90@rdsunx.crd.ge.com>, volpe@bart.crd.ge.com (Christopher R. Volpe) writes
>> ....
>> Secondly, even if prototypes in general were necessary for correct code
>> generation, and even if all struct pointers didn't "smell alike", it still
>> doesn't explain why function-prototype scope is needed. Even if it were
>> necessary that pointer-type parameters be pointers to complete types, it is
>> still possible (in fact, it's pretty much mandatory if you want to actually
>> *use* the function) to declare the complete structure type before the
>> prototype.
>
>No, 

Could you be more specific? Which of my above statements do you disagree with
and why?



>the pointer-form is the problem.  Prototype-scope prevents the
>parameter here
>	int k(struct S *)
>from being fullie declared.  Its type is not the type of anie of these,
>if later declared:
>	struct S
>	{	char f;
>	};
>or
>	struct S
>	{	int f;
>	};
>or
>	struct S
>	{	double f;
>	}

I know that. That's the problem.

>.  Hereby the problem of dealing with sundrie kinds of pointers, if
>needed, is swept under the rug.



How so? It's impossible to use the declared function now, so how are any
problems "swept under the rug" as a result of having prototype scope? I stand
by my claim that it is still possible and mandatory to declare the complete
structure type before the prototype.



--

Chris Volpe				Phone: (518) 387-7766 (Dial Comm 8*833
GE Corporate R&D			Fax:   (518) 387-6560
PO Box 8, Schenectady, NY 12301		Email: volpecr@crd.ge.com
Technical Details
Message-ID: <43mnv1$nkg@rdsunx.crd.ge.com>
Path: arc1-ca.pugleaf.net!bart.crd.ge.com!volpe
References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> <43l3er$rp@caip.rutgers.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!bart.crd.ge.com!volpe
From: volpe@bart.crd.ge.com (Christopher R. Volpe)
Newsgroups: comp.std.c
Subject: Re: Function-prototype scope: Why?
Date: 19 Sep 1995 15:34:57 GMT
Organization: GE Corporate Research & Development
Sender: volpe@bart (Christopher R. Volpe)
Distribution: world
Message-ID: <43mnv1$nkg@rdsunx.crd.ge.com>
References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> <43l3er$rp@caip.rutgers.edu>
Reply-To: volpe@ausable.crd.ge.com
NNTP-Posting-Host: bart.crd.ge.com