public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: bdale@gag.com (Bdale Garbee)
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] gcc won't inline function returning struct?
Date: Wed, 31 Oct 2001 21:39:03 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590698805421@msgid-missing> (raw)

I'm playing around with Thomas Sailer's user space soundcard modems for use
on amateur radio links.  One of the things he includes is a small library of 
complex math functions intended to be used inline.  The way this is coded is
to create a .h file with the gcc "magic" use of extern and inline, like so:

	typedef struct {
        	float re, im;
	} complex;

	/*
 	* Complex multiplication.
 	*/
	extern __inline__ complex cmul(complex x, complex y)
	{
        	complex z;
	
        	z.re = x.re * y.re - x.im * y.im;
        	z.im = x.re * y.im + x.im * y.re;
	
        	return z;
	}

A couple of C source files in the same directory include the header containing
this code, and are aggregated into a .a that an application in an adjacent
directory links against later in the build process.

On my Pentium laptop running Debian with a 2.95.4 compiler, this builds and
runs fine.  On my Itanium system running Debian with everyone's favorite 2.96
plus lots of patches, the above function fails to inline with the complaint

	complex.h: In function `cmul':
	complex.h:14: warning: inline functions not supported for this 
		return value type

when I add a -Winline.  I get the same complaint with gcc-3.0.  The effect of
this is that since the function isn't inlined it's left as an extern, and the
linker can't find it when it tries to link the application against this lib
later in the build.

So, my question.  Why does the ia64 gcc not handle this when the i386 gcc 
likes it just fine?  That's way beyond my toolchain knowledge right now...

Bdale


             reply	other threads:[~2001-10-31 21:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-31 21:39 Bdale Garbee [this message]
2001-10-31 22:23 ` [Linux-ia64] gcc won't inline function returning struct? Jim Wilson
2001-10-31 23:02 ` n0ano
2001-11-01  0:27 ` Jim Wilson
2001-11-01  0:40 ` Matthew Wilcox
2001-11-01  0:49 ` Jim Wilson

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=marc-linux-ia64-105590698805421@msgid-missing \
    --to=bdale@gag.com \
    --cc=linux-ia64@vger.kernel.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