FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.

Home Page:https://www.FreeRTOS.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Missing type cast in vTaskGetInfo causes compiler warning

KnoerleMaTLS opened this issue · comments

Description
The following assignment in the function "vTaskGetInfo" causes a compiler warning due to a missing type cast:
pxTaskStatus->pxTopOfStack = pxTCB->pxTopOfStack;

The member "pxTopOfStack" of the "tskTaskControlBlock" struct type is defined as:
volatile StackType_t* pxTopOfStack;

While the member "pxTopOfStack" of the "xTASK_STATUS" struct type is defined as:
StackType_t* pxTopOfStack;

Therefore the following compiler warning is issued by the mentioned assignment.
discarded 'volatile' qualifier at assignment: conversion from unsigned int volatile * to unsigned int *

Target

  • Toolchain and version: TASKING VX-toolset for TriCore: C compiler v6.3r1 Build 19041558

Host

  • Host OS: Linux

To Reproduce
Define "configRECORD_STACK_HIGH_ADDRESS" as 1.

Expected behavior
The file "tasks.c" can be compiled without any warnings.

Additional context
To reproduce the issue the changes of PR730 must be taken into account.

Already fixed by #735.
Sorry for duplicate, just checked the code of the corresponding pull request which initially introduced the new feature.