
264 Part III
Avoidance 44: Use inline functions instead of parameterized macros whenever
possible. Example:
inline DOUBLE(const int value) {
return (value + value);
}
Answer 114: The problem is that the optimizer feels free to rewrite the code.
Some optimizers will stick variables in registers to make the code go faster.
For example, one optimized version of this program looks like:
1 /************************************************
2 * sum -- Sum the sine of the numbers from 0 to *
3 * 0x3FFFFFFF. Actually we don't care *
4 * about the answer, all we're trying to *
5 * do is create some sort of compute *
6 * bound job so that the status_monitor *
7