#include extern void f ( uint16_t para1, uint16_t para2 ); extern uint16_t g ( struct str **strp ); struct str { void ( *f ) ( uint16_t para ); }; void example ( void ) { struct str *p; uint16_t a[ 3 ], b[ 3 ], i; /* ----------------- Example code from MISRA C:2012 begin ----------------- */ #define COPY_ELEMENT( index ) ( a[ ( index ) ] = b[ ( index ) ] ) COPY_ELEMENT ( i++ ); /* Non-compliant */ extern volatile uint16_t v1, v2; uint16_t t; t = v1 + v2; /* Non-compliant */ extern volatile uint8_t PORT; PORT = PORT & 0x80u; /* Compliant */ i = 0; f ( i++, i ); /* Non-compliant */ p->f ( g ( &p ) ); /* Non-compliant */ /* ------------------ Example code from MISRA C:2012 end ------------------ */ }