Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!usc!ucla-cs!uci-ics!rfg From: rfg@ics.uci.edu (Ron Guilmette) Newsgroups: comp.lang.c++ Subject: Re: Does C++ 2.0 Emit Following C Construct? Message-ID: <1989Oct12.000225.2250@paris.ics.uci.edu> Date: 12 Oct 89 00:02:25 GMT References: <32793@cornell.UUCP> <1000032@hpclscu.HP.COM> Sender: news@paris.ics.uci.edu (Network News) Reply-To: Ron Guilmette Organization: University of California, Irvine - Dept of ICS Lines: 28 In article <1000032@hpclscu.HP.COM> shankar@hpclscu.HP.COM (Shankar Unni) writes: >> Try this little gem (but first make sure that your CC script does *not* >> invoke the GNU C compiler): >> >> int i; >> int main () >> { >> i = sizeof (main); >> return 0; >> } > >I got perfectly reasonable code from 2.0 (formatting cleaned up): > > int main () > { > _main(); > { > i = (sizeof main ); > return (int )0 ; > } > } > >Looks kosher. You mean your compiler choked on "(sizeof main)"? You mean that yours didn't???? Maybe you had better have a look at the ANSI C (draft) standard. // rfg