int i, j;
i = j = 1;
j is highlighted by VS 2010 with warning:
The variable is assigned but never used
Why i is “used” and j – is not?
An addition with cooperation with Daniel:
int i, j, k, l, m;
i = j = k = l = m = 1;
Only m is highlighted.
I think it’s a bug, It should be in reverse order,
=operator is a right precedent operator according to Microsoft documentation. So when we have i = j = 1 it should parse it as i = (j = 1) in this case value ofjused to initializeiso the compiler should sayiinitiated but never used, notj.