Author: petepete Date: Jan 15, 2008 03:38
Keith Thompson wrote:
>> 3) Never use pre or post increment as parameters to macros,
>> as a macro
>> might use the parameter more than once. As a consequence, item 2
>> should be "never use increment or decrement on parameters to a
>> function", as you might not know if this is a real function, or that
>> this was implemented as a macro.
>
> The standard library functions may be additionally implemented as
> macros, but any such macros must evaluate each of their arguments
> exactly once (except for a very few cases that are explicitly
> documented).
The exact number of cases, is two: getc and putc.
The standard also explicitly states
that the stream arguments with side effects,
should not be used with getc and putc.
|