# Freertos static data type usage

**URL:** <https://forums.freertos.org/t/freertos-static-data-type-usage/19187>\
**Category:** Kernel\
**Created:** [February 14, 2024, 6:03am UTC](https://forums.freertos.org/t/freertos-static-data-type-usage/19187 "2024-02-14T06:03:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcastle](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mcastle](https://forums.freertos.org/u/mcastle)\
**Post date:** [February 14, 2024, 6:03am UTC](https://forums.freertos.org/t/freertos-static-data-type-usage/19187/1 "2024-02-14T06:03:58Z")

</div>

Hello,

what is the difference between task declaration using static void versus void. What data type of tasks functions I should use?

For example:

```auto
void vTaskName(void *pvParameters){
//task content
}

```

or

```auto
static void vTaskName(void *pvParameters){
//task content
}

```

My tasks are created using xTaskCreate and never deleted.

---

<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:** [February 14, 2024, 6:13am UTC](https://forums.freertos.org/t/freertos-static-data-type-usage/19187/2 "2024-02-14T06:13:16Z")

</div>

The `static` keyword/specifier is related to C-language and works as defined in the standard. It’s unrelated to and doesn’t change the task function type.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [February 14, 2024, 2:13pm UTC](https://forums.freertos.org/t/freertos-static-data-type-usage/19187/3 "2024-02-14T14:13:29Z")

</div>

The keyword “static” when applied to something at the “file-scope”, like a function definition (which is what a task essentially is) just affects the availability of the name of that thing, making it only accessible in that file, and not from other translation units. (The object might still be, if its address is passed to something, like is done when creating the task). The only affect of making the task function static is to mean the call to xTaskCreate will need to be from something in that file, and not a “cross-file” reference to that function.

“static” is a somewhat overloaded word in “C” (and more so in C++) with different meaning in different contexts.
