Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!ucla-cs!uci-ics!rfg From: rfg@ics.uci.edu (Ron Guilmette) Newsgroups: comp.lang.c++ Subject: Re: g++ core dump from improper use of extern "C" Message-ID: <25B0E7F7.6002@paris.ics.uci.edu> Date: 14 Jan 90 20:58:31 GMT References: <1581@aber-cs.UUCP> <18157@umn-cs.CS.UMN.EDU> <25AFE9B7.14113@paris.ics.uci.edu> Reply-To: rfg@ics.uci.edu (Ron Guilmette) Organization: UC Irvine Department of ICS Lines: 42 In article <25AFE9B7.14113@paris.ics.uci.edu> rfg@ics.uci.edu (Ron Guilmette) writes: >In article <18157@umn-cs.CS.UMN.EDU> mike@umn-cs.cs.umn.edu (Mike Haertel) writes: >> >>Just to be pedantic, this is not strictly true. It is OK to >>declare a pointer to an incomplete type, so this works *here*. >>But consider the following counterexample: >> >>/*1*/ struct b { int x; }; >>/*2*/ >>/*3*/ void foo() { >>/*4*/ struct b; >>/*5*/ struct a { struct b *b; } *a; >>/*6*/ struct b { struct a *a; } *b; >>/*7*/ >>/*8*/ b = a->b; >>/*9*/ } >> >>In this case, line 4 is necessary to make "struct b" an incomplete type. >>Otherwise, the "struct b *b" in line 5 would refer to the "struct b" >>declared on line 1... > >Buzzzzzzzt! Sorry, no! But thanks for playing our game. Just for being >such a good sport you win a free copy of our home game, complete with the >new 2.0 Reference Manual. OK, before you folks send me 8 zillion letters telling me what a dumbs*** I am for having posted this, let me just say that I know already! Section 9.1 of the new 2.0 manual does indeed require the declaration of struct b in the example above. I guess that the booby prize (the 2.0 Ref. Man.) goes to me instead, together with a set of spectacles to read it with! > >:-) :-) :-) Well, at least I had to good sense to put in smiles so that nobody would think that I was being hostile. (No... not hostile... just stupid. I trust that stupidity is a forgivable sin in this particular newsgroup.) // rfg