🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1671

Re: Scope of incomplete types

#1671
From: Larry Jones
Date: Mon, 10 Sep 1990 14:05
29 lines
1697 bytes
In article <1990Sep9.194037.346@charis.UUCP>, wmm@charis.UUCP (William M. Miller) writes:
>  
>         struct X* p1;
>         void f() {
>            struct X* p2;
>            p2 = p1;             /* A */
>            }
>         struct X { int i; };    /* B */
>  
> INTERPRETATION 1: This is a legal compilation unit.  p1 and p2 have the same
> type, so assignment A is allowed.  Implication: the wording in the Standard
> requiring a completing declaration to be in the same block does not apply to
> the declaration inside f() because the type was introduced in the outer
> scope.  Implication: the wording in the Rationale mentioning a definition is
> excessively restrictive.

Bingo!

The wording in section 3.5.2.3 could perhaps be clearer, but that
is certainly the intent of the committee.  Remember, the Rationale
is not a part of the standard -- it uses much less formal and
precise language to try to explain >why< the standard says what it
says, not to explain >what< it says.
----
Larry Jones                         UUCP: uunet!sdrc!thor!scjones
SDRC                                      scjones@thor.UUCP
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150-2789             AT&T: (513) 576-2070
I think my cerebellum just fused. -- Calvin
Technical Details
Message-ID: <167@thor.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sdrc!thor!scjones
References: <1990Sep5.191221.5118@charis.UUCP> <13765@smoke.BRL.MIL> <1990Sep9.194037.346@charis.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sdrc!thor!scjones
From: scjones@thor.UUCP (Larry Jones)
Newsgroups: comp.std.c
Subject: Re: Scope of incomplete types
Message-ID: <167@thor.UUCP>
Date: 10 Sep 90 14:05:33 GMT
References: <1990Sep5.191221.5118@charis.UUCP> <13765@smoke.BRL.MIL> <1990Sep9.194037.346@charis.UUCP>
Organization: SDRC, Cincinnati
Lines: 29