This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: PR 15815


On Wed, 09 Jun 2004 11:06:54 -0700, Mark Mitchell <mark@codesourcery.com> wrote:

> Geoff Keating wrote:
>
>> I can think of one case.  Suppose you're writing a shared library, and
>> you want to make as much shared as possible.  It would be nice to be
>> able to force a single out-of-line copy of the inline function, so
>> that it doesn't get put in every application that uses the library.
>
> In that case, you probably didn't really want it to be inline.  If you
> really did want it to be inline with the shared object, but not in other
> parts of your application, then you need to create two different copies of
> the function -- an inline one and a non-inline one, which calls the inline
> version.  Or, you can make the inline body visible only within the shared
> library, using macros.
>
> "#pragma interface" and "#pragma implementation" are just unportable ways
> of doing that kind of thing.

Unportable, but much simpler than the workarounds you describe, and still
quite widespread--throughout libjava, for instance.  Removing this
extension will cause a lot of headaches.

The PR is about misleading documentation.  Removing the feature seems like
a significant overreaction.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]