未定義動作なので、どんな結果になってもおかしくないですね。
1999年の規格であるC99に近い
N1256を見てみます。
N1256 4. Conformanceより引用
2 If a ‘‘shall’’ or ‘‘shall not’’ requirement that appears outside of a constraint is violated, the
behavior is undefined. Undefined behavior is otherwise indicated in this International
Standard by the words ‘‘undefined behavior’’ or by the omission of any explicit definition
of behavior. There is no difference in emphasis among these three; they all describe
‘‘behavior that is undefined’’.
N1256 6.5 Expressionsより引用
2 Between the previous and next sequence point an object shall have its stored value
modified at most once by the evaluation of an expression. 72) Furthermore, the prior v alue
shall be read only to determine the value to be stored. 73)
73) This paragraph renders undefined statement expressions such as
i = ++i + 1;
a[i++] = i;
while allowing
i = i + 1;
a = i;
今回の式
においては、
pの値が書換えられ、かつpの値がpの新しい値の決定以外(更新前のpが指す場所に書き込む値の計算)に使われ、
その計算はpの更新の前に行われるか後に行われるかが決定できないので、
shallと書かれた条件に違反し、未定義動作になります。
すなわち、本が間違っているということになるでしょう。
参考
これに相当するルールは、2011年の規格であるC11に近い
N1570ではわかりやすくなっています。
N1570 6.5 Expressionsより引用
2 If a side effect on a scalar object is unsequenced relative to either a different side effect
on the same scalar object or a value computation using the value of the same scalar
object, the behavior is undefined. If there are multiple allowable orderings of the
subexpressions of an expression, the behavior is undefined if such an unsequenced side
effect occurs in any of the orderings. 84)
3 The grouping of operators and operands is indicated by the syntax. 85) Except as specified
later, side effects and value computations of subexpressions are unsequenced. 86)
代入演算子=の左辺と右辺のどっちが先に評価されるかは決まっていないので、
左辺に含まれるpへの副作用p++と、右辺に含まれるpの値を用いた値の計算*pの順番が定まらず、未定義動作になります。