ThrowTheSwitch / Ceedling

Ruby-based unit testing and build system for C projects

Home Page:http://throwtheswitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ceedling is confused by the __attribute__ directive in the header

GlebPlekhotko opened this issue · comments

Hello.

This issue lies atop of the similar one I've described here for the CMock. In short, I'm working with a project, which uses FreeRTOS. And my attempt to mock the task.h module failed because of the __attribute__ at the beginning of the function :
__attribute__( ( used ) ) void vTaskSwitchContext( void ) ;

More specifically there were two spaces between braced which compelled CMock to do so. If remove them everything is fine:
__attribute__(( used )) void vTaskSwitchContext( void ) ;

Problem is this fix does work for the standalone CMock call, but doesn't help for the Ceedling. Issue remains the same. Though it is still possible to overcome it by slightly altering task.h file and putting it to the support directory.

Original:
portDONT_DISCARD void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
Altered:
void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
Macro portDONT_DISCARD is defined in the portmacro.h file:
#define portDONT_DISCARD __attribute__( ( used ) )

Hope that helps somehow.
Thanks for your time!