Post #2598463
2023-03-17 19:58 UTC
Also, this is not only the case for function argument evaluation order but similarly applies to the order in which operands are evaluated (except for &&, ||, comma operator and trigraph). For example gcc seems to evaluate a+b from left-to-right while MSVC evaluates it (usually?) from right-to-left.
Replies (3)
-
@ovrim@wien.rocks 2023-03-18 17:52
@slomo@toot.cat The concept is the sync point which guarantees that all side effects are done. And defining too much takes freedom from the optimizer.
-
@LeDuc@epicure.social 2023-03-18 19:34
@slomo@toot.cat Please do not forget how old C is, at that time many strange things happened not only in computer science...
-
@Wlm@mastodon.gamedev.place 2023-03-18 20:58
@slomo@toot.cat Operators are just syntactic sugar for functions anyway, so same thing really ;).