Article View: comp.std.c
Article #4029Re: Function-prototype scope: Why?
From: halasz
Date: Tue, 19 Sep 1995 00:38
Date: Tue, 19 Sep 1995 00:38
30 lines
1426 bytes
1426 bytes
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, 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;
}
. Hereby the problem of dealing with sundrie kinds of pointers, if
needed, is swept under the rug.
But I deem it wizer to ask the authors, if we can reach them.
Technical Details
Message-ID:
<43l3er$rp@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@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: 18 Sep 1995 20:38:51 -0400 Organization: Rutgers University Message-ID: <43l3er$rp@caip.rutgers.edu> References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> NNTP-Posting-Host: caip.rutgers.edu