[BUG] MISRA C 2012 Rule 9.3 violation in SMP configuration: xYieldPendings is partially initialized

Abierto
#1,491 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@20000419 ya está trabajando en esto.

Desde el 22/9/2026.

  • #1493 de @alguien — cerrado sin fusionar
  • #1498 de @20000419 — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
18/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
c

Línea de trabajo

The array is declared in tasks.c near line 510 as xYieldPendings[ configNUMBER_OF_CORES ] = { pdFALSE }. Before editing, read open PR #1498 and closed PR #1493 to see what was tried and whether the work is already covered. Done means the initializer is changed to { 0 } or MISRA.md gets a documented deviation, as the issue proposes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Describe the bug
In the SMP configuration (configNUMBER_OF_CORES > 1), tasks.c:510 declares:

    PRIVILEGED_DATA STATIC volatile BaseType_t xYieldPendings[ configNUMBER_OF_CORES ] = { pdFALSE };

The array has configNUMBER_OF_CORES elements, but the initializer list has a single
element, so the remaining elements are only implicitly zero-initialized. This is a violation of MISRA C:2012 Rule 9.3 (Required): "Arrays shall not be partially initialized".
PR #973 fixed the same pattern for the same rule in portable/Common/mpu_wrappers_v2.c (= { NULL } → = { 0 }). pdFALSE is ( ( BaseType_t ) 0 ) (include/projdefs.h:52), so this is the same class.

Expected behavior
No Rule 9.3 violation. Proposed change (no behavior change, keeps all cores
zero-initialized).

PRIVILEGED_DATA STATIC volatile BaseType_t xYieldPendings[ configNUMBER_OF_CORES ] = { 0 };

Alternatively, add a documented deviation in MISRA.md if the implicit zero-initialization is intentional and preferred as-is.

Lenguaje dominante
C
Estrellas
4.6k
Forks
1.6k
Merge medio
2 d 22 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de FreeRTOS/FreeRTOS-Kernel

Todos los issues de FreeRTOS/FreeRTOS-Kernel

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.