Topic : How can i force a inline function

Forum : ARM

Original Post
Post Information Post
June 10, 2010 - 2:19pm
Guest

I have some functions defined as inline.

How can I make sure an inline function is compiled as an inline function?

I have tried the "Force Inline = Yes" option but no change.

For example, this:

inline void __NOP() { __ASM volatile ("nop"); }

Replies
Post Information Post
+1
0
-1
July 8, 2010 - 6:30pm
Guest

GCC doc on inline functions

Have you set the optimization level to -O1 or above?

Have you tried a function prototype like this:
inline void someFunction (const char) __attribute__((always_inline));

Have you tried compiling with the -Winline flag and seeing if there is a particular reason your functions can't be inlined?

Also, I know that at least some RIDE headers have a #define inline static inline so if you ever get a "duplicate 'static'" compile error when you declare something as static inline, that might be why.