I was fiddling with Code Blocks today and got a curious warning message. It was not an error, and it compiled and run with expected result, but the warning message picked my curiosity.
Code:
while (i < right)
*(array + i) = *(buffer - left + i++);
and
while (i >= 0 && *(array + i) > key)
*(array + i + 1) = *(array + i--);
got me error messages like:
warning: operation on 'i' may be undefined
but the similar code:
if (l < left + middle &&
(r == right || min == *(array + l)))
*(buffer + i) = *(array + l++);
else
*(buffer + i) = *(array + r++);
did not result in warning messages. Note that all snippets are from the same project/file.