C1008 and C1107 error while compiling freerots(v10.3.1) with codewarriorv5.9 in windows system

Hi everybody,
I got a complie error when I compiled freertos(v10.3.1) with codewarriorV5.1,I would be very glad if you could tell me what the problem is.

Error message:
1-Error: C1008: Typedef name expected;
2-Error: C1007: Type specifier mismatch;

Freertos version: V10.3.1
Compiler information: CodeWarrior V5.9 for Hcs12;
Target MCU: Mc9s12g128
PC system:Windows 7

Extra info:
1.In source files(xx_func.c), “FreeRtos.h” is included before “task.h” and “list.h”

One more info:Memory model is Banked.

Which source file are you building? A FreeRTOS source file or one of your own? If one of your own, and you include FreeRTOS.h followed by task.h then I don’t see any reason why the compiler would generate that error. You should not be including list.h directly though - only the kernel files do that.

Thanks for your reply.
Which source file are you building? A FreeRTOS source file or one of your own?
Ans: One source file from my own project.
You should not be including list.h directly
Ans: I don’t include “list.h” directly in my source, only “Freertos.h” and “task.h” are included, and “stdint.h”(provided in freertos directory) is also included.

Two more questions:
1.Any limits in including head files of freertos except the rule we mentioned above?
2. Could you share some methods to find out where the bug is?

Best regards

FreeRTOS.h includes portable.h which includes portmacro.h where TickType_t is defined. This is pretty straight forward…
However, if your compiler tool chain already provides stdint.h (as it should nowadays) use the provided one. There is only a stdint.readme in the original FreeRTOS/include directory.

CodeWarrior V5.1 doesn’t provide “stdint.h”, so I have already used the “stdint.readme” in the Freertos directory, I also uncomment those typedefs in this files.
This is my file structure:

Hmm… then you have to check/track the include hierarchy starting with FreeRTOS.h including the desired stdint.h, portable.h -> portmacro.h files.
With GCC I’d e.g. use/patch a simple #warning “included” in each of those header files or something to do so. I’m not familiar with the CodeWarrior compiler.

1 Like

Thanks for your great idea, I have found the bug that three head files build a loop like the picture followed: