# Difference between variables in FreeRtOS

**URL:** <https://forums.freertos.org/t/difference-between-variables-in-freertos/2010>\
**Category:** Kernel\
**Created:** [November 16, 2008, 3:57pm UTC](https://forums.freertos.org/t/difference-between-variables-in-freertos/2010 "2008-11-16T15:57:48Z")\
**Posts on this page:** 3\
**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:** [November 16, 2008, 3:57pm UTC](https://forums.freertos.org/t/difference-between-variables-in-freertos/2010/1 "2008-11-16T15:57:48Z")

</div>

**[willywortel](https://sourceforge.net/u/willywortel/)** wrote on [Sunday, November 16, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/5712cccf/#ddec):

In the demo code’s that i’ve read, (PIC32) it contains variables only defined by:

portBASE\_TYPE  
portSHORT  
portLONG  
etc.

What is the benefit of using those assignments instead of short / long / int etc.?

Does it save the variable to static when the task gets killed?

---

<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:** [November 16, 2008, 4:11pm UTC](https://forums.freertos.org/t/difference-between-variables-in-freertos/2010/2 "2008-11-16T16:11:41Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, November 16, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/5712cccf/#ddec/4dfa):

[FreeRTOS.org](http://FreeRTOS.org) runs on 8, 16 and 32bit devices, so these definitions are just for portability.&nbsp; Each port defines portSHORT to be a 16 bit type, portLONG to be a 32bit type and portBASE\_TYPE to be the most efficient type for the architecture (normally 8bits for 8bit architectures, 16bits for 16bit architectures and 32bits for 32bit architectures).

The demo code also follows this convention because it is run on all the supported processors.&nbsp; Your application code can do whatever, it does not need to use the same definitions and can use short, char, etc. directly if preferable.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2008, 1:17pm UTC](https://forums.freertos.org/t/difference-between-variables-in-freertos/2010/3 "2008-11-24T13:17:16Z")

</div>

**[cherepanov](https://sourceforge.net/u/cherepanov/)** wrote on [Monday, November 24, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/5712cccf/#ddec/4dfa/178e):

Richard!  
Is there some port/compiller there short int (portSHORT) is not 16 bit wide?  
Is there some port/compiller there long int (portLONG) is not 32 bit wide?
