This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: static inline


He HongFu wrote:
> Hi, all:
> 	I declare a function as following:	
> 	static inline void foo () {
>     }
> 	Is foo() function just like declare "inline"? i.e, the modifier "static" is invalid here.

The answer depends on what language you are compiling, which you didn't
specify.  Is this GNU C, ISO C90, ISO C99, GNU C++, or ISO C++?

For GNU C, static inline means that if all calls to the function are
inlined, and the function's address is not taken, then we will not emit
an out-of-line copy of the function.

This is covered in the GCC manual.  See
	http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Inline.html#Inline
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]