Article View: gnu.gcc.help
Article #42267Re: inline not working for member functions
From: Tom Breton
Date: Sat, 06 Jan 1996 00:00
Date: Sat, 06 Jan 1996 00:00
15 lines
1247 bytes
1247 bytes
rj@eli.wariat.org (Robert J. Brown) writes:
> Anyway, when I compile C++ code in a little test file that only uses one
> class defined in a header file, I cannot get 'inline' to work for the
> member functions. The info text for gcc says that member functions
> should automatically get inlined. They don't! I even tried
> -finline-functions on the gcc command line. This last trick DID get the
> functions I declared in the main.cc file to become inlined, but the
> member function are still getting jal-ed to in the assembler source code
> output by -S.
Two things: -O0 (No optimization at all) will not inline anything. And
aside from that, the compiler will generate non-inlined copies too
(probably what you saw) unless you tell it not to.
Tom
Technical Details
Message-ID:
<DKs2p3.5FE@world.std.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<RJ.96Jan6044241@eli.wariat.org>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,b0b3fcc035ac9eea X-Google-Attributes: gid11318c,public From: tob@world.std.com (Tom Breton) Subject: Re: inline not working for member functions Date: 1996/01/06 Message-ID: <DKs2p3.5FE@world.std.com> X-Deja-AN: 134325080 references: <RJ.96Jan6044241@eli.wariat.org> organization: BREnterprises x-posted-by: My own casual posting program reply-to: tob@world.std.com newsgroups: gnu.gcc.help