Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!usc!apple!bbn!saustin@bbn.com From: saustin@bbn.com Newsgroups: comp.lang.c++ Subject: Re: Why doesn't inline always work? Keywords: inline fails Message-ID: <53294@bbn.COM> Date: 9 Mar 90 22:36:18 GMT References: <540@janus.Quotron.com> <2370@dataio.Data-IO.COM> Sender: news@bbn.COM Lines: 22 bright@Data-IO.COM (Walter Bright) writes: >In article <540@janus.Quotron.com> todd@janus.Quotron.com (Todd Booth) writes: > No. Yes. GNU g++ does! >C++ compilers inline-expand functions by substituting expressions. As far as I can gather, g++ plonks the machine instructions wherever the inline function was mentionned. It is not constrained to substitite a valid C expression for the function call. I should think that cfront could be modified to behave correctly by writing loads of "if" statements, in which case there would be a near one-to-one correspondence between the flow of the C and and the resulting assembler output. Steve Austin