# xSTATIC\_QUEUE incompatibility

**URL:** <https://forums.freertos.org/t/xstatic-queue-incompatibility/24981>\
**Category:** Kernel\
**Created:** [May 6, 2026, 12:01am UTC](https://forums.freertos.org/t/xstatic-queue-incompatibility/24981 "2026-05-06T00:01:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sri-subramanian-koll](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/sri-subramanian-koll/32/6227_2.png) [@sri-subramanian-koll](https://forums.freertos.org/u/sri-subramanian-koll)\
**Post date:** [May 6, 2026, 12:01am UTC](https://forums.freertos.org/t/xstatic-queue-incompatibility/24981/1 "2026-05-06T00:01:37Z")

</div>

Hi, I know the types in FreeRTOS.h are meant to be used at our peril, but since they’re there, it would be nice if they’re consistent with the kernel definitions.

Specifically, xSTATIC\_QUEUE is mostly right, except for:

void \* pvDummy1[3];

meant to account for the first few pointer fields in queue.c:QueueDefinition, except that QueueDefinition only has 2 pointers before the union.

Thanks.

---

<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:** [May 6, 2026, 1:20pm UTC](https://forums.freertos.org/t/xstatic-queue-incompatibility/24981/2 "2026-05-06T13:20:48Z")

</div>

First, the “STATIC” types in FreeRTOS.h ARE meant to be used in user code, they are needed to statically allocate their corresponding objects. Errors of extra storage are less important, as it is just a slight waste of memory, but really shouldn’t be there.

I do wonder if it makes sense to add a “static\_assert” in the code that defines the actual structures to confirm they are the same size. (If FreeRTOS doesn’t want to add the C11 dependency, there are ways to do it is prior versions, they just look worse.)

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [May 7, 2026, 10:17am UTC](https://forums.freertos.org/t/xstatic-queue-incompatibility/24981/3 "2026-05-07T10:17:59Z")

</div>

These are the first few members in QueueDefinition:

```auto
    int8_t * pcHead; 
    int8_t * pcWriteTo;

    union
    {
        QueuePointers_t xQueue;
        SemaphoreData_t xSemaphore;
    } u;

```

QueuePointers\_t is:

```auto
typedef struct QueuePointers
{
    int8_t * pcTail; 
    int8_t * pcReadFrom;
} QueuePointers_t;

```

SemaphoreData\_t is:

```auto
typedef struct SemaphoreData
{
    TaskHandle_t xMutexHolder; // This is a pointer
    UBaseType_t uxRecursiveCallCount;
} SemaphoreData_t;

```

Note that first member of both QueuePointers\_t and SemaphoreData\_t is a pointer. The definition in xSTATIC\_QUEUE clubs pcHead, pcWriteTo and first members of QueuePointers\_t and SemaphoreData\_t together and then contains a union for second members of QueuePointers\_t and SemaphoreData\_t.

Though it is not very readable, it is not meant for application developers and we have this assert to catch any discrepancy: [FreeRTOS-Kernel/queue.c at main · FreeRTOS/FreeRTOS-Kernel · GitHub](https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/queue.c#L398-L409).
