I'm trying to utilize misra C:2012 checking in from cppcheck (v2.9). However, when executing on a particular file I get the following violations:
vehicle_controller.c:1494:2: style: All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define’d before evaluation. [misra-c2012-20.9] #if OS == LINUX_OS ^ src/emb/bwk/
I'm using the following command to execute:
$ cppcheck -DOS=LINUX_OS --addon=misra.json vehicle_controller.c
Is there a different way to pass #define
to be properly picked up by the misra checking?