MISRA Discussion Forums

Full Version: Multiple local initialsaions in a single line
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

dose a line of the form

Code:
int i=0,j=0,k,l;
considered a misuse of the comma operator.
meaning, the line is considered as composed of multiple statements in a single line.
if so then what about, just plain

Code:
int i,jk;

Thanks

-Alon
In an list of declarators, the comma is being used as a separator rather than an operator. There are no comma operators in the examples given and therefore no violation of Rule 12.10.