I think the following may be a false positive (or I've misunderstood the MISRA rule):
When defining an array using a defined constant, cppcheck 2.5 (with MISRA rukles enabled) reports a MISRA error 2012-18.8 (variable length arrays shall not be used) if the definition is ibn an external file.
e.g.:
In test.c:
I think the following may be a false positive (or I've misunderstood the MISRA rule):
When defining an array using a defined constant, cppcheck 2.5 (with MISRA rukles enabled) reports a MISRA error 2012-18.8 (variable length arrays shall not be used) if the definition is ibn an external file.
e.g.:
In test.c:
with header test.h:
if the #define ANUMBER 10u is in the local C file (uncomment above) everything is fine, if it's in the header it throws the error.
Last edit: Alan Braddy 2021-08-31
False alarm - missing include link
what default paths where cppcheck search includes?
cppcheck does not have default paths.