Article View: comp.std.c
Article #4044Re: Function-prototype scope: Why?
From: James Kanze US/ESC 60/3/141 #407...
Date: Tue, 19 Sep 1995 09:36
Date: Tue, 19 Sep 1995 09:36
31 lines
2001 bytes
2001 bytes
In article <43kb6s$ntr@news0.rain.rg.net> Paul Long <plong@perf.com>
writes:
|> kanze@gabi-soft.fr (J. Kanze) wrote:
|> >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.
Probably. I don't have my C standard here to check, and was simply
remembering one of the differences between C and C++. In fact,
though, checking the difference (in the draft C standard), it says
nothing about C not using name equivalence, only that in certain
contexts (of which, presumably, this is not one), C allows equivalent
types.
This also corresponds more to what I remember way back when, when I
was tracking the draft C standard (and actively working in C, instead
of C++).
--
James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils en informatique industrielle --
-- Beratung in industrieller Datenverarbeitung
Technical Details
Message-ID:
<KANZE.95Sep19113624@slsvhdt.lts.sel.alcatel.de>Path:
arc1-ca.pugleaf.net!xlink.net!slsv6bt!newsReferences:
<43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> <43j9oo$62d@gabi.gabi-soft.fr> <43kb6s$ntr@news0.rain.rg.net>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!xlink.net!slsv6bt!news From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) Subject: Re: Function-prototype scope: Why? In-Reply-To: Paul Long's message of 18 Sep 1995 17:44:59 GMT Message-ID: <KANZE.95Sep19113624@slsvhdt.lts.sel.alcatel.de> Sender: news@lts.sel.alcatel.de Organization: SEL References: <43cgmb$cec@news0.rain.rg.net> <43er80$458@caip.rutgers.edu> <43i723$j90@rdsunx.crd.ge.com> <43j9oo$62d@gabi.gabi-soft.fr> <43kb6s$ntr@news0.rain.rg.net> Date: 19 Sep 1995 09:36:23 GMT