public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: <securehell@hushmail.com>
To: <gcc-help@gcc.gnu.org>
Subject: Trouble inlining code
Date: Fri, 10 Feb 2006 21:04:00 -0000	[thread overview]
Message-ID: <200602102104.k1AL46GL004045@mailserver3.hushmail.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello group,

I am trying to inline a function with gcc-3.4.4 on a linux x86_64
platform.

The function I am trying to inline is in a header file:

foo.h:

inline int *your_func(int *a) { if (!a) return (NULL); return
(*a++);}

Any file that I compile that includes this header and code compiles
without error:

gcc -m64 -c -Wall -Winline -fPIC -O3 -o bar.o bar.c

But when I try to link, I get a mess...

/usr/bin/gcc -shared -Wl,--whole-archive -Wall -Winline -fPIC -o
libfiles.so file.o libfoo.a -Wl,--no-whole-archive

libfoo.a(file.o)(.text+0x0): In function `my_func':
: multiple definition of `your_func'
libfoo.a(bar.o)(.text+0x0): first defined here

What could I be missing that will inline this function for me?

Thanks,

SH
-----BEGIN PGP SIGNATURE-----
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.4

wkYEARECAAYFAkPs/8EACgkQRBFe1uc9INoi7gCaAkhb9S5rcYWmyEwmvK34mILqH1UA
oJmf9uXEUpXxMYmIYoil2WrYz246
=wiWt
-----END PGP SIGNATURE-----


             reply	other threads:[~2006-02-10 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-10 21:04 securehell [this message]
2006-02-10 21:11 ` Sven Eschenberg
2006-02-11  9:39 ` "Sébastien L."
2006-02-10 21:27 securehell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200602102104.k1AL46GL004045@mailserver3.hushmail.com \
    --to=securehell@hushmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).