🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4048

Re: Function-prototype scope: Why?

#4048
From: halasz
Date: Wed, 20 Sep 1995 00:40
38 lines
1688 bytes
In article <43mnv1$nkg@rdsunx.crd.ge.com>, volpe@bart.crd.ge.com (Christopher R. Volpe) writes
> Could you be more specific? Which of my above statements do you disagree with
> and why?
Why function-prototype scope is needed: the pointer-problem is enough
for to explain it.

=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.
I know not what you mean, but I see a problem in seeing hou to generate
code for a pointer ere that which the pointer points to is known.

> 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.
Well, yes, not declaring it raizes a problem, with a "solution" that forbids
use of the so declared function.

But if this declaration is just as forbiddind of use,
	int k(struct U
		{	int j;
		} *);
I too wunder what the standard-writers were up to.
Technical Details
Message-ID: <43nnt2$ksp@caip.rutgers.edu>
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail
References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43mnv1$nkg@rdsunx.crd.ge.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail
From: halasz@caip.rutgers.edu
Newsgroups: comp.std.c
Subject: Re: Function-prototype scope: Why?
Date: 19 Sep 1995 20:40:02 -0400
Organization: Rutgers University
Message-ID: <43nnt2$ksp@caip.rutgers.edu>
References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43mnv1$nkg@rdsunx.crd.ge.com>
NNTP-Posting-Host: caip.rutgers.edu