nimble-code / Cobra

An interactive (fast) static source code analyzer
139 stars 31 forks source link

Consistent user control of C preprocessing #21

Closed mjeronimo closed 3 years ago

mjeronimo commented 3 years ago

Currently, when using the MISRA 2012 ruleset, Cobra invokes the C preprocessor, even without the -cpp option being specified. To make it more consistent, and easier to integrate with the Space ROS CI system, I recommend only running the preprocessor if the user requests -cpp.

nimble-code commented 3 years ago

all cpp on and cpp off commands have now been commented out from the query libraries this means that some checks will not do much if the user has, or does not have, preprocessing enabled (e.g., checks on #include or #define directives will only be useful if no preprocessing is done, etc.) removing the commands makes execution more predictable though