Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
In this example, the programmer has mistakenly omitted the comparison operator (see \[[MSC02-A. Avoid errors of omission]\]) from the conditional statement, which should be {{c \!= EOF}}. After macro expansion, the conditional expression is incorrectly evaluated as a binary operation: {{c-1}}. This is syntactically correct, even though it is certainly not what the programmer intended. 

Parenthesizing the -1 in the declaration of EOF ensures that the macro expansion is evaluated correctly.

...