Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Message-ID: Newsgroups: comp.sys.amiga.programmer Subject: Re: Is this valid C? Distribution: world References: <1991May5.222328.16225@csis.dit.csiro.au> <616@lysator.liu.se> <38542@ditka.Chicago.COM> Date: 11 May 91 15:50:49 PST Organization: Not an Organization In article <38542@ditka.Chicago.COM> comeau@ditka.Chicago.COM (Greg Comeau) writes: >In article <616@lysator.liu.se> zap@lysator.liu.se (Zap Andersson) writes: >>struct foop *p; >>struct foop { int a; char *b }; >>main() { p->a = 39; /* Will complier barf here? */ } > >There will be a no barf since at the ->a, foop is no longer an incomplete >type. It is not a problem. > >- Greg That is, assuming 'p' is initialized to something valid :-) struct foop *p; struct foop { int a; char *b }; struct foop xx; main() { p = &xx; p->a = 39; ... } -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA