#include void example ( void ) { /* ----------------- Example code from MISRA C:2012 begin ----------------- */ int32_t *p1 = 0; /* Non-compliant */ int32_t *p2 = ( void * ) 0; /* Compliant */ #define MY_NULL_1 0 #define MY_NULL_2 ( void * ) 0 if ( p1 == MY_NULL_1 ) /* Non-compliant */ { } if ( p2 == MY_NULL_2 ) /* Compliant */ { } /* ------------------ Example code from MISRA C:2012 end ------------------ */ } void goodExample ( void ) { /* ----------------- Example code from MISRA C:2012 begin ----------------- */ #include extern void f ( uint8_t *p ); f ( NULL ); /* Compliant */ /* ------------------ Example code from MISRA C:2012 end ------------------ */ }