public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] gcc won't inline function returning struct?
@ 2001-10-31 21:39 Bdale Garbee
  2001-10-31 22:23 ` Jim Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bdale Garbee @ 2001-10-31 21:39 UTC (permalink / raw)
  To: linux-ia64

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-11-01  0:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-31 21:39 [Linux-ia64] gcc won't inline function returning struct? Bdale Garbee
2001-10-31 22:23 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox