|
From: | Zane D. Purvis |
Subject: | Re: [avr-gcc-list] Inline code and firmware update questions |
Date: | Mon, 15 Aug 2005 11:58:35 -0400 |
On Aug 15, 2005, at 10:47 AM, Trampas wrote:
First off is I tried to create some inline functions in C, yes I know inline is for C++, well the code was not inline as I hoped and the compiler had noerror or warning. So I assume I can not inline code in C without using macros?
You can use inline for C code. Check out the gcc manual at http:// gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Inline.html
In gcc 3, the inlined function's definition (body) must be before any calls to the inlined function in your source file. Based on a comparison between version 3.3 and 4.0 of gcc for PowerPC, it looks like version 4.0 of gcc is quite a bit smarter about what to inline when the "inline" modifier is used, and doesn't require the definition to be before all uses. The PowerPC 4.0 version does what you expect it to do -- I'm assuming the 4.0 avr version behaves the same way.
[Prev in Thread] | Current Thread | [Next in Thread] |