To narrow down the search, I took the preprocessed task.h module and fed it to the standalone CMock to exclude influence of the Ceedling. Here is how vTaskSwitchContext function looked there:
__attribute__( ( used ) ) void vTaskSwitchContext( void ) ;
Hence, it seems, that CMock does not recognize attribute at the beginning of the function and considers it as a some sort of return type. I thought that it might be caused by spaced between brackets (who knows, right?) and removed them:
__attribute__(( used )) void vTaskSwitchContext( void ) ;
And it worked! After this little modification CMock generated absolutely correct mocking module:
Hello!
In my project there is a "task.h" file. Obviously, it comes from the FreeRTOS. I'm trying to mock it up using CMock. CMock is invoked by the Ceedling.
Attempt failed with the following message:
So there is a syntax mistake in the generated mock. I peeked that file and saw this:
And this:
To narrow down the search, I took the preprocessed task.h module and fed it to the standalone CMock to exclude influence of the Ceedling. Here is how vTaskSwitchContext function looked there:
__attribute__( ( used ) ) void vTaskSwitchContext( void ) ;
And generated mock was corrupted too:
Hence, it seems, that CMock does not recognize attribute at the beginning of the function and considers it as a some sort of return type. I thought that it might be caused by spaced between brackets (who knows, right?) and removed them:
__attribute__(( used )) void vTaskSwitchContext( void ) ;
And it worked! After this little modification CMock generated absolutely correct mocking module:
A little, but annoying issue, especially if met in library or third-party code which is not expected to be altered.