Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple local initialsaions in a single line
#1
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
<t></t>
Reply
#2
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.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)