04-09-2025, 10:55 AM
Based on the example in MISRA 2023 C this is non-compliant:
but what about in initialization? According to PCLP tool it's acceptable:
My view is that de/increment shouldn't be mixed with anything and it should be alone in one line to avoid any chance of confusion.
Please clarify.
Code:
int u8a=0; // implied
u8a = u8b++; //don't accept assignment and increment on the same line
but what about in initialization? According to PCLP tool it's acceptable:
Code:
int u8a = u8b++;
My view is that de/increment shouldn't be mixed with anything and it should be alone in one line to avoid any chance of confusion.
Please clarify.