Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!rex!ukma!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!hp-ses!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.lang.c++ Subject: Re: Does C++ 2.0 Emit Following C Construct? Message-ID: <1000033@hpclscu.HP.COM> Date: 11 Oct 89 18:34:48 GMT References: <32793@cornell.UUCP> Organization: Hewlett-Packard Calif. Language Lab Lines: 20 > i = sizeof (main); Corrections from our ANSI C expert: This expression is not legal, according to the ANSI C standard (function names are not converted to pointers to functions when they are arguments to the "sizeof" operator (section 3.2.2.1), and there is a constraint under the sizeof operator (section 3.3.3.4) that specifically forbids expressions of function type). So cfront should catch this expression and flag it as an error. If it intends for "main" to be converted to a function pointer, it should emit explicit C code to do that ("&main") (which, in my opinion, would be a bad thing to do). If not, it should flag the error. I stand corrected. ----- Shankar Unni E-Mail: Hewlett-Packard California Language Lab. Internet: shankar@hpda.hp.com Phone : (408) 447-5797 UUCP: ...!hplabs!hpda!shankar