А вот мне кажется, что здесь не все так просто. Sequence point перед входом в функцию гарантирует, что side effect инкремента произойдет до входа в функцию. А вот про side effect присваивания известно только, что он произойдет где-то до sequence point в конце full expression. Где гарантия, что это будет после возвращения из функции? Кроме, понятно, здравого смысла.
Текст стандарта: When calling a function (whether or not the function is inline), there is a sequence point after the evaluation of all function arguments (if any) which takes place before execution of any expressions or statements in the function body. There is also a sequence point after the copying of a returned value and before the execution of any expressions outside the function).
no subject
Date: 2010-06-09 09:53 am (UTC)Вопрос, разумеется, сугубо теоретический.
no subject
Date: 2010-06-09 09:58 am (UTC)When calling a function (whether or not the function is inline), there is a sequence point after the evaluation of all function arguments (if any) which takes place before execution of any expressions or statements in the function body. There is also a sequence point after the copying of a returned value and before the execution of any expressions outside the function).