# FreeRTOS 4.0.4, GCC: Inlining

**URL:** <https://forums.freertos.org/t/freertos-4-0-4-gcc-inlining/1503>\
**Category:** Kernel\
**Created:** [July 19, 2006, 11:13am UTC](https://forums.freertos.org/t/freertos-4-0-4-gcc-inlining/1503 "2006-07-19T11:13:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 19, 2006, 11:13am UTC](https://forums.freertos.org/t/freertos-4-0-4-gcc-inlining/1503/1 "2006-07-19T11:13:19Z")

</div>

**[thomas\_nittel](https://sourceforge.net/u/thomas_nittel/)** wrote on [Wednesday, July 19, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/44ba538e/#7d32):

Hi,

when the module FreeRTOSV4.0.4\FreeRTOS\Source\portable\GCC\ARM7\_AT91SAM7S\portISR.c is compiled with arm-elf-gcc 4.1.0 the following warning appears  
…  
Source/portable/GCC/ARM7\_AT91SAM7S/portISR.c -o portISR.o  
…/…/Source/FreeRTOS\_4.0.4/Source/portable/GCC/ARM7\_AT91SAM7S/portISR.c: In function ‘vPreemptiveTick’:  
…/…/Source/FreeRTOS\_4.0.4/Source/include/task.h:832: warning: inlining failed in call to ‘vTaskIncrementTick’: function body not available  
…/…/Source/FreeRTOS\_4.0.4/Source/portable/GCC/ARM7\_AT91SAM7S/portISR.c:144: warning: called from here

Obviously inlining doesn’t work with GCC.

gcc.pdf, page 216 recommends to put the function definition in a header file with the keywords inline and extern.  
If ‘vTaskIncrementTick’ is put as ‘extern inline void vTaskIncrementTick( void )’ in ‘task.h’ inlining will work with GCC, too. Of cause some declarations of variables, functions and macros of ‘tasks.c’ are addtionally necessary in ‘task.h’.

I found the above mentioned document at [http://www.gnuarm.org/](http://www.gnuarm.org/). Its title is ‘Using the GNU Compiler Collection’ for GCC 3.3.2 and dated from 20. December 2002. A newer version doesn’t seem to be available.

The compiler command which I used is  
arm-elf-gcc -c -I…/…/Source/Demo -I…/…/Source/FreeRTOS\_4.0.4/Source/include -I…/…/Source/FreeRTOS\_4.0.4/Source/portable/GCC/ARM7\_AT91SAM7S -I…/…/Source/Utilities -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wno-strict-aliasing -Winline -D THUMB\_INTERWORK -D SAM7\_GCC -mthumb-interwork -mcpu=arm7tdmi -MMD -finline-limit=1000&nbsp; -Os …/…/Source/FreeRTOS\_4.0.4/Source/portable/GCC/ARM7\_AT91SAM7S/portISR.c -o portISR.o

Best regards

Thomas

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 19, 2006, 11:53am UTC](https://forums.freertos.org/t/freertos-4-0-4-gcc-inlining/1503/2 "2006-07-19T11:53:05Z")

</div>

**nobody** wrote on [Wednesday, July 19, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/44ba538e/#7d32/627e):

The inline is a legacy thing.&nbsp; Most portmacro.h files include the lilne

#define inline

to remove it from the code and prevent any warnings.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 19, 2006, 2:13pm UTC](https://forums.freertos.org/t/freertos-4-0-4-gcc-inlining/1503/3 "2006-07-19T14:13:09Z")

</div>

**[thomas\_nittel](https://sourceforge.net/u/thomas_nittel/)** wrote on [Wednesday, July 19, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/44ba538e/#7d32/627e/f692):

Hi,  
of cause warnings can be avoided this way. But I want my code to be inlined so that the function call overhead is spared. For an example see my posting ‘RE: FreeRTOS 4.0.4, AT91SAM7X256, Timertick  
2006-07-19 14:05’  
Regards  
Thomas
