The attached file has 4 simple functions to reproduce a false positive of the rule 17.8.
I ran cppcheck using the following command
cppcheck.exe --premium=misra-c-2025 --std=c99 misra_17_8_fp.c
It shows the checker flags any write through a pointer parameter as if the parameter itself had changed. MISRA C Rule 17.8 is about modifying the parameter; writing to the object it points to is explicitly allowed.
I use a trial license my colleague Diogo sent to the rest of the embedded SW team to evaluate cppcheck.
The version of Cppcheck I am using is Cppcheck Premium 26.6.0.
The tool correctly triggers one wraning and throws 3 false positives for rule 17.8.
Hello cppcheck team,
The attached file has 4 simple functions to reproduce a false positive of the rule 17.8.
I ran cppcheck using the following command
cppcheck.exe --premium=misra-c-2025 --std=c99 misra_17_8_fp.c
It shows the checker flags any write through a pointer parameter as if the parameter itself had changed. MISRA C Rule 17.8 is about modifying the parameter; writing to the object it points to is explicitly allowed.
I use a trial license my colleague Diogo sent to the rest of the embedded SW team to evaluate cppcheck.
The version of Cppcheck I am using is Cppcheck Premium 26.6.0.
The tool correctly triggers one wraning and throws 3 false positives for rule 17.8.
Best regards,
Ahmed.