In the following example, cppcheck (2.5) produces a warning for violating MISRA rule 8.2 at the first line of source code. However, the prototype is correct and all parameters are named. The uncommon syntax of declaring a "pointer to array 2 of int" seems to be triggering a false positive.
Furthermore, cppcheck doesn't report a warning that no parameters are actually passed in main to example_func, but perhaps that is related to the error at hand.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the following example, cppcheck (2.5) produces a warning for violating MISRA rule 8.2 at the first line of source code. However, the prototype is correct and all parameters are named. The uncommon syntax of declaring a "pointer to array 2 of int" seems to be triggering a false positive.
To reproduce, run cppcheck (version 2.5) as follows:
cppcheck --enable=all --addon=misra.py file.c
This should produce the following output:
Furthermore, cppcheck doesn't report a warning that no parameters are actually passed in main to example_func, but perhaps that is related to the error at hand.
Thanks!
The problem is in Cppcheck itself. I created the following ticket: https://trac.cppcheck.net/ticket/10376 .
Thanks for the quick response!
Is this the best place and format to report issues, or would it be better to request an account on Trac sometime?
It's okay to report some bugs here. But for convenience, you can ask for Trac account from Daniel, as described here.