# Types assignment in FreeRTOS

**URL:** <https://forums.freertos.org/t/types-assignment-in-freertos/7331>\
**Category:** Kernel\
**Created:** [July 20, 2018, 2:24pm UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331 "2018-07-20T14:24:24Z")\
**Posts on this page:** 7\
**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 20, 2018, 2:24pm UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/1 "2018-07-20T14:24:24Z")

</div>

**[migraichen](https://sourceforge.net/u/migraichen/)** wrote on [Friday, July 20, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#29ee):

Hey everyone,

i’m trying to Port FreeRTOS to a 8051 Softcore Controller ([https://github.com/jaruiz/light52](https://github.com/jaruiz/light52)) but when i compile the File  
tasks.c ([https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/tasks.c#l1011](https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/tasks.c#l1011)) i receive the following error

$ sdcc --debug -o obj/ -D\_\_LIGHT52\_\_ -Isrc/FreeRTOS/include -Isrc/config -I…/include -Isrc/FreeRTOS/portable/SDCC/light52 -c src/FreeRTOS/tasks.c

src/FreeRTOS/tasks.c:1011: error 47: indirections to different types assignment  
from type ‘struct TaskControlBlock\_t generic\* fixed’  
to type ‘struct TaskControlBlock\_t generic\* int fixed’

src/FreeRTOS/tasks.c:1954: error 78: incompatible types  
from type ‘struct TaskControlBlock\_t generic\* near\* fixed’  
to type ‘struct TaskControlBlock\_t generic\* int generic\* const fixed’

How do I have to cast these types ?

best regards  
Michael

---

<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:** [July 20, 2018, 3:53pm UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/2 "2018-07-20T15:53:10Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, July 20, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#29ee/077c):

In the last release (10.0.1) these types were void \*. In the head  
revision of SVN they are no longer void \* but ‘type safe’ - each type is  
different. Are you using the latest release (downloaded as a zip or exe  
file) or checking the files out of SVN?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 21, 2018, 11:33am UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/3 "2018-07-21T11:33:50Z")

</div>

**[migraichen](https://sourceforge.net/u/migraichen/)** wrote on [Saturday, July 21, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#f50d):

Hey Richard,

yes, i cheched out the trunk via SVN.

I can try a different version on monday and see if that’s compiling.

Thanks for your help, have a nice weekend.  
Michael

---

<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:** [July 21, 2018, 4:05pm UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/4 "2018-07-21T16:05:45Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, July 21, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#f50d/b93f):

Hmm, the version in SVN has been tested with several compilers with no  
issues. Could this be an issue with SDCC? I last attempted to use  
typesafe handles some years back and had to back out the changes due to  
a debugger issue. I believe the code is all perfectly valid C, and  
quite old C too, nothing that relies on a later version of the standard.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 23, 2018, 9:56am UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/5 "2018-07-23T09:56:26Z")

</div>

**[migraichen](https://sourceforge.net/u/migraichen/)** wrote on [Monday, July 23, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#0f67):

Hey Richard,

I changed to version 10.0.0 today but I’m still getting these errors.  
So I tried different Versions of SDCC. Last week I had Vesion 3.5.0 from Ubuntu Repository installed.  
Version 3.6.0 and 3.7.0 gives me additional errors:

src/FreeRTOS/tasks.c:558: error 226: no type specifier for ‘prvInitialiseNewTask parameter 6’  
src/FreeRTOS/tasks.c:738: error 226: no type specifier for ‘xTaskCreate parameter 6’  
src/FreeRTOS/tasks.c:831: error 226: no type specifier for ‘prvInitialiseNewTask parameter 6’

parameter 6 is always “TaskHandle\_t \* const pxCreatedTask”

I tried to analyse the TaskHandle\_t structure and TCB\_t structure but they seem to be equal as far as I can see. I guess I have to see how SDCC interprets them.

What other 8051 compilers did you use ?

Best regards  
Michael

---

<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:** [July 23, 2018, 6:44pm UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/6 "2018-07-23T18:44:06Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, July 23, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#0f67/926e):

SDCC is the only one I have used - but it was a VERY long time ago, so  
no doubt an obsolete version of the compiler. V10.0.0 is very well  
exercised with many compilers, and uses the void\* handles instead of the  
typesafe handles.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 25, 2018, 11:38am UTC](https://forums.freertos.org/t/types-assignment-in-freertos/7331/7 "2018-07-25T11:38:25Z")

</div>

**[migraichen](https://sourceforge.net/u/migraichen/)** wrote on [Wednesday, July 25, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/788db98d/#2c40):

SDCC seems to by complaning about the “const” if I change “TaskHandle\_t \* const pxCreatedTask” to “TaskHandle\_t \* pxCreatedTask” for each funktion i get over this point.

Why did you define it as const, since it gets set during the Initialization ?
