Click on image to see enlargment
The local college coach was using a C program to check the validity of his formations but he suspects something wrong when the player count shows 3 rather than the expected 11. What's going wrong?
bug666.c lint Output
--- Module: bug666.c (C) _ while( Add( wingT[i++], sum ) ) bug666.c(14) : Warning 666: Expression with side effects passed to repeated parameter 1 in macro 'Add'
Reference Manual Explanation
666 Expression with side effects passed to repeated parameter Integer in macro 'Symbol' -- A repeated parameter within a macro was passed an argument with side-effects. For example: #define ABS(x) ((x) < 0 ? -(x) : (x)) ... ABS( n++ ) Although the ABS macro is correctly defined to specify the absolute value of its argument, the repeated use of the parameter x implies a repeated evaluation of the actual argument n++. This results in two increments to the variable n. [22, §20.6] Any expression containing a function call is also considered to have side-effects.
If you have comments or questions about this bug, please post them to our Discussion Forum
Previous Bug - Bug #521 - September 2006