Re: Beginner post-increment question
  Home FAQ Contact Sign in
comp.lang.c only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.c Profile…
 Up
Re: Beginner post-increment question         


Author: pete
Date: Jan 15, 2008 03:38

Keith Thompson wrote:
>
> borkhuis@gmail.com writes:
> [...]
>> 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.
Show full article (0.79Kb)
no comments