Ahmed Wefky - 3 days ago

Hello cppcheck team,

Cppcheck Premium 26.6.0 reports 8.9 for a static variable that is used in one function and also in an initialiser in the same file. Rule 8.9 applies only when the variable only appears in a function.

The command I run is
cppcheck --premium=misra-c-2025 --std=c99 misra_8_9_fp.c

The checker appears to count only references inside functions and to ignore references in initialisers in the same file.

I use a trial license sent to our colleague Diogo for tool evaluation.

The attached file can be used to reproduce this issue.

Best regards,
Ahmed Wefky.