Nested function calls order of evaluation

后端 未结 4 1084
孤街浪徒
孤街浪徒 2020-12-17 00:52

It\'s well-known that the order of evaluation of a function\'s arguments in unspecified and can differ between different compilers.

What doesn\'t seem so clear is wh

4条回答
  •  青春惊慌失措
    2020-12-17 01:11

    I don't know what the standard says, but I think that if it matters to you, then you should probably re-arrange the code so that you know what's going to happen in which order (temp variables are your friends). Even if you figure out what the standard says, AND if we assume that your compiler implements that correctly, you're still leaving a maintenance time bomb, because your successors WON'T know everything you do.

提交回复
热议问题