public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: <securehell@hushmail.com>
To: <gcc-help@gcc.gnu.org>, <eschenb@cs.uni-frankfurt.de>
Subject: Re: Trouble inlining code
Date: Fri, 10 Feb 2006 21:27:00 -0000	[thread overview]
Message-ID: <200602102127.k1ALRWHT008625@mailserver3.hushmail.com> (raw)

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

"static inline" did the trick.

Danke shoene.

SH

On Fri, 10 Feb 2006 16:11:52 -0500 Sven Eschenberg <eschenb@cs.uni-
frankfurt.de> wrote:
>Hi,
>
>you might want to check:
>
>http://www.greenend.org.uk/rjk/2003/03/inline.html
>
>Esp. the part with the examples ... I think what you want is a
>static
>inline (not absolutely sure though)
>
>Greets
>
>-Sven
>
>securehell@hushmail.com wrote:
>
>>-----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/8EACgkQRBFe1uc9INoi7gCaAkhb9S5rcYWmyEwmvK34mILqH1
>UA
>>oJmf9uXEUpXxMYmIYoil2WrYz246
>>=wiWt
>>-----END PGP SIGNATURE-----
>>
>>
>>
>>
-----BEGIN PGP SIGNATURE-----
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.4

wkYEARECAAYFAkPtBT0ACgkQRBFe1uc9INqfYwCeMEkljlCSm1O56q/0h1PmlWy+bP4A
n1FQmyhH09R9rmv7AyXoviRNvcOn
=t5j0
-----END PGP SIGNATURE-----


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

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

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=200602102127.k1ALRWHT008625@mailserver3.hushmail.com \
    --to=securehell@hushmail.com \
    --cc=eschenb@cs.uni-frankfurt.de \
    --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).