Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!ucsd!ames!sgi!shinobu!odin!delrey!shap From: shap@delrey.sgi.com (Jonathan Shapiro) Newsgroups: comp.lang.c++ Subject: Re: Why doesn't inline always work? Keywords: inline fails Message-ID: <5041@odin.SGI.COM> Date: 8 Mar 90 21:20:35 GMT References: <540@janus.Quotron.com> Sender: news@odin.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 23 In article <540@janus.Quotron.com> todd@janus.Quotron.com (Todd Booth) writes: >I know of a 2.0 C++ beta product that does not expand inline >functions that contain a goto, for, do, or while, as inline. > >Do any other C++ products? > >--todd booth / Quotron All cfront-based C++ systems have this limitation. The problem is that in order to perform inlining, cfront turns the function into a single expression (remember that the function needs to return a result, so it needs to be an expression). Since C has no notion of returning a value from a block, and goto is not legal within an expression, cfront has no way to generate inline loops. This is one of the areas in which generating object code would be a big win. Jonathan Shapiro Silicon Graphics, Inc.