FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.62k stars 1.09k forks source link

[BUG] Missing type cast in vTaskGetInfo causes compiler warning #917

Closed KnoerleMaTLS closed 8 months ago

KnoerleMaTLS commented 8 months ago

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

Host

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.

KnoerleMaTLS commented 8 months ago

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