Warning: redundant redeclaration of 'vTaskAllocateMPURegions'

A warning is triggered while compiling the FreeRTOS project in the MPU port, indicating the redundant declaration of the ‘vTaskAllocateMPURegions’ function (mpu_prototypes.h:125:6: warning: redundant redeclaration of ‘vTaskAllocateMPURegions’ [-Wredundant-decls]). And followed by the warning “include/task.h:755:6: note: previous declaration of vTaskAllocateMPURegions’ was here void vTaskAllocateMPURegions( TaskHandle_t xTaskToModify,”.

Based on the comment on mpu_prototypes.h (When the MPU is used the standard (non MPU) API functions are mapped to equivalents that start “MPU_”, … ), should the vTaskAllocateMPURegions() function be MPU_vTaskAllocateMPURegions()?

Yes, that is right. This line should be MPU_vTaskAllocateMPURegions - https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/include/mpu_prototypes.h#L125.

Here is the PR to fix it - Fix prototype in mpu_prototypes.h by aggarg · Pull Request #797 · FreeRTOS/FreeRTOS-Kernel · GitHub

1 Like