In C99, is f()+g() undefined or merely unspecified?

后端 未结 3 1055
既然无缘
既然无缘 2020-11-30 05:15

I used to think that in C99, even if the side-effects of functions f and g interfered, and although the expression f() + g() does not

3条回答
  •  春和景丽
    2020-11-30 05:55

    See Annex C for a list of sequence points. Function calls (the point between all arguments being evaluated and execution passing to the function) are sequence points. As you've said, it's unspecified which function gets called first, but each of the two functions will either see all the side effects of the other, or none at all.

提交回复
热议问题