#include uint8_t f ( void ); void g ( uint8_t ); struct str { uint8_t x; }; void example ( void ) { uint8_t u8a, u8b, u8c, x, a[ 3 ], i, *p; struct str b, *c; /* ----------------- Example code from MISRA C:2012 begin ----------------- */ u8a = u8b++; /* Non-compliant */ u8a = ++u8b + u8c--; /* Non-compliant */ ++u8b; u8a = u8b + u8c; u8c--; x++; /* Compliant */ a[ i ]++; /* Compliant */ b.x++; /* Compliant */ c->x++; /* Compliant */ ++( *p ); /* Compliant */ *p++; /* Compliant */ ( *p )++; /* Compliant */ if ( ( f ( ) + --u8a ) == 0u ) /* Non-compliant */ { } g ( u8b++ ); /* Non-compliant */ u8a = ( 1u == 1u ) ? 0u : u8b++; /* Non-compliant */ if ( u8a++ == ( ( 1u == 1u ) ? 0u : f ( ) ) ) /* Non-compliant */ { } /* ------------------ Example code from MISRA C:2012 end ------------------ */ }