[ofa-general] Re: __always_inline macro usage

Gleb Natapov glebn at voltaire.com
Tue Oct 23 00:23:20 PDT 2007


On Tue, Oct 23, 2007 at 09:22:09AM +0200, Jack Morgenstein wrote:
> On Monday 22 October 2007 23:42, Roland Dreier wrote:
> > Something is fishy with your compilation process.  __always_inline
> > should never be visible to gcc; it is a macro defined in <linux/compiler.h>.
> > 
> 
> Might this be a gcc installation problem?
> 
> I have the following file (foobar.c):
> 
> ==============
> static __always_inline int foo(int i) {return (i+1); }
> int main(void) { return foo(5); }
> ==============
And where is "#include <linux/compiler.h>" here?

> 
> If I just do:  gcc foobar.c,
> I get the following output:
> 	foobar.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
> 
> If I modify the file to:
> ==============
> static __attribute__((always_inline)) int foo(int i) {return (i+1); }
> int main(void) { return foo(5); }
> ==============
> 
> and do gcc foobar.c,
> the compilation succeeds.
> 
> I'm using gcc (GCC) 4.1.0 (SUSE Linux), on SLES 10.
> 
> -- Jack
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

--
			Gleb.



More information about the general mailing list