This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Weak symbols and inline
- From: Paul Smith <paul at mad-scientist dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 28 Feb 2014 17:24:36 -0500
- Subject: Re: Weak symbols and inline
- Authentication-results: sourceware.org; auth=none
- References: <1393527190 dot 2823 dot 515 dot camel at pdsdesk> <alpine dot DEB dot 2 dot 10 dot 1402272019340 dot 3594 at laptop-mg dot saclay dot inria dot fr> <1393529487 dot 2823 dot 520 dot camel at pdsdesk> <CAH6eHdRuG3KuhBFeFtbxt9G7SoQ84yS7mvR+OdpXQs6CyjQRLw at mail dot gmail dot com> <1393620036 dot 2823 dot 571 dot camel at pdsdesk> <alpine dot DEB dot 2 dot 10 dot 1402282151360 dot 3586 at laptop-mg dot saclay dot inria dot fr> <1393624405 dot 2823 dot 580 dot camel at pdsdesk> <alpine dot DEB dot 2 dot 10 dot 1402282255470 dot 3586 at laptop-mg dot saclay dot inria dot fr>
- Reply-to: paul at mad-scientist dot net
On Fri, 2014-02-28 at 23:05 +0100, Marc Glisse wrote:
> You mean always_inline? Well, it has the advantage that it doesn't
> force the function to be inlined ;-)
Yes, sorry. But what's wrong with forcing inline? :-). We're already
well beyond worrying about portability, and into "does it work"-ability.
> > If I don't include the header file, then the code silently falls back to
> > the system new/delete.
>
> It shouldn't be hard to check if nm -D yourlib.so contains _Znwm as U,
> you can add that to the Makefile.
Yes, I was playing with this. Pretty straightforward I agree.
> Well, if you control the Makefile, you can actually add -include mynew
> on the command line so it can't be forgotten...
Unfortunately that's much harder to do in a portable way (GNU/Linux,
MacOSX, Windows). I can run the nm check only on Linux and that should
be good enough, since almost all the code is the same on all three
platforms.