Hi folks,
Is it possible to check at compile time if the MISRA checker is enabled?
I find myself doing things like this quite a bit:
#ifdef __TMS320C28XX__
#pragma CHECK_MISRA("none")
#endif
#include <stdint.h>
#ifdef __TMS320C28XX__
#pragma RESET_MISRA("all")
#endif
To cater to the case where I might build a module, say in GCC to run unit-tests in a different environment (the desktop), which of course does not understand the MISRA pragmas.
Now, all is fine using the __TMS320C28XX__ compiler macro to check if the pragma should be compiled or not, but I was wondering if there is currently one I could use to give a tighter qualification that this is specifically for the C28x with MISRA checking rather than just when building for the C28x in general?
Something like
#ifdef __TMS320C28XX_MISRA_ON__
#pragma CHECK_MISRA("none")
#endif
#include <stdint.h>
#ifdef __TMS320C28XX_MISRA_ON__
#pragma RESET_MISRA("all")
#endif
Thanks, T