From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23732 invoked by alias); 10 Feb 2006 21:11:49 -0000 Received: (qmail 23715 invoked by uid 22791); 10 Feb 2006 21:11:48 -0000 X-Spam-Check-By: sourceware.org Received: from chaplin.rz.uni-frankfurt.de (HELO chaplin.rz.uni-frankfurt.de) (141.2.22.74) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Feb 2006 21:11:45 +0000 Received: from emma.rz.uni-frankfurt.de ([141.2.22.59]) by chaplin.rz.uni-frankfurt.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.50) id 1F7fYM-0000R1-Le for gcc-help@gcc.gnu.org; Fri, 10 Feb 2006 22:11:42 +0100 Received: from dumbo.ghl40.whgl.uni-frankfurt.de ([141.2.119.130]) by emma.rz.uni-frankfurt.de with esmtp (Exim 4.50) id 1F7fYJ-0005Of-OS for gcc-help@gcc.gnu.org; Fri, 10 Feb 2006 22:11:39 +0100 Message-ID: <43ED0198.1090703@cs.uni-frankfurt.de> Date: Fri, 10 Feb 2006 21:11:00 -0000 From: Sven Eschenberg User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: Trouble inlining code References: <200602102104.k1AL46GL004045@mailserver3.hushmail.com> In-Reply-To: <200602102104.k1AL46GL004045@mailserver3.hushmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg00094.txt.bz2 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/8EACgkQRBFe1uc9INoi7gCaAkhb9S5rcYWmyEwmvK34mILqH1UA >oJmf9uXEUpXxMYmIYoil2WrYz246 >=wiWt >-----END PGP SIGNATURE----- > > > >