3 ms·
The issue is for some programmers propensity to use ++ and -- whenever they can. So you end up with max(a++, b--) Which expands to ((a++)>(b--)?(a++
by hornetblack 12y ago
The issue is for some programmers propensity to use ++ and -- whenever they can. So you end up with
max(a++, b--)
Which expands to
((a++)>(b--)?(a++):(b--))
creating unexpected results. The solution is, don't use return values of `++` and `--` in calls, unless you know it's a function, and always will be. Upper-case macros may help, but then you need to make sure all macros are upper case.