|
|
CBFalconer wrote:
>
> pete wrote:
> > Ioannis Vranos wrote:
> >
> ... snip ...
> >
> >> K&R2 mentions the following:
> >>
> >> "printf("%d %d\n", ++n, power(2,n)); /* WRONG */
> >>
> >> can produce different results with different compilers, depending
> >> on whether n is incremented before power is called".
> >>
> >> That's why I call it implementation-defined behaviour.
> >
> > It's unspecified behavior. The power(2,n) function call,
> > introduces a sequence point that the other code examples don't
> > have. This is all about sequence points.
>
> Not quite. Also order of parameter evaluation.
By "this" I was refering to OP's confusion
about what was undefined
versus implementation defined and unspecified behavior.
--
pete
|
|