Re:A glimpse of undefined behavior in C
by SilasX on Saturday November 30, 2013 @06:49PM
(#6825265)
(int i=0;i<10;i++)
would count as three lines for purposes of that rule, and the
i++
as one. I could have been more precise, but I thought it would be understood.
The point is, to be on the safe side, don't use ++/-- in any line (in the sense of ;{}-delimited statement) that is also doing something else.
>Don't forget that =, += , ... can all be abused in the same way.
I didn't, and people should use the same safeguards around them, i.e. don't mix them within lines that do other things, "cleverness" or "C golf" be damned.
The point is, to be on the safe side, don't use ++/-- in any line (in the sense of ;{}-delimited statement) that is also doing something else.
>Don't forget that =, += , ... can all be abused in the same way.
I didn't, and people should use the same safeguards around them, i.e. don't mix them within lines that do other things, "cleverness" or "C golf" be damned.