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

**URL:** <https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435>\
**Category:** Kernel\
**Created:** [December 30, 2020, 2:52am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435 "2020-12-30T02:52:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielsun-oneisall](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@danielsun-oneisall](https://forums.freertos.org/u/danielsun-oneisall)\
**Post date:** [December 30, 2020, 2:52am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/1 "2020-12-30T02:52:45Z")

</div>

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;

 ![ErrorMessage](https://d2v6vdsk2p900z.cloudfront.net/original/2X/1/1ca1fe76f2fa8312f32dca4adac42532e8da6f4e.jpeg)

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”

---

<div class="post-metadata">

**Author:** ![danielsun-oneisall](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@danielsun-oneisall](https://forums.freertos.org/u/danielsun-oneisall)\
**Post date:** [December 30, 2020, 3:00am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/2 "2020-12-30T03:00:20Z")

</div>

One more info:Memory model is Banked.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [December 30, 2020, 4:03am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/3 "2020-12-30T04:03:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![danielsun-oneisall](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@danielsun-oneisall](https://forums.freertos.org/u/danielsun-oneisall)\
**Post date:** [December 30, 2020, 5:19am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/4 "2020-12-30T05:19:39Z")

</div>

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  
Daniel

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [December 30, 2020, 10:23am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/5 "2020-12-30T10:23:20Z")

</div>

`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.

---

<div class="post-metadata">

**Author:** ![danielsun-oneisall](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@danielsun-oneisall](https://forums.freertos.org/u/danielsun-oneisall)\
**Post date:** [December 30, 2020, 10:31am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/6 "2020-12-30T10:31:14Z")

</div>

Thanks!  
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:  
 ![structure](https://d2v6vdsk2p900z.cloudfront.net/original/2X/3/376912a60df2cf5aad3971d496f48bc910c339c7.jpeg)

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [December 30, 2020, 10:58am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/7 "2020-12-30T10:58:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![danielsun-oneisall](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@danielsun-oneisall](https://forums.freertos.org/u/danielsun-oneisall)\
**Post date:** [December 31, 2020, 1:43am UTC](https://forums.freertos.org/t/c1008-and-c1107-error-while-compiling-freerots-v10-3-1-with-codewarriorv5-9-in-windows-system/11435/8 "2020-12-31T01:43:07Z")

</div>

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

 ![headfileloop](https://d2v6vdsk2p900z.cloudfront.net/original/2X/5/5930e15b7dfab61069291c382cb33954229a3ed2.jpeg)
