"Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression"
Is storing the same value to an object twice "modifying" it once or twice? :-)
-
-
-
Clang devs encourage you to report false positives as bugs, here: https://clang-analyzer.llvm.org
-
I dare you to report this Clang warning as a false positive :)pic.twitter.com/ueIaoHIQu2
End of conversation
New conversation -
-
-
twice!
-
You're no fun. Do you have a citation for that though? Is "modifying" actually defined?
-
I am simply following the rule that the worst reasonable interpretation is probably the best one
-
I agree we probably have to interpret it that way, but...
-
It seems likely the motivation of the UB was ambiguity of which store happens first, which doesn't arise if both are the same value.
-
I agree with that motivation. but then there are modern compilers...
-
It's easy to see how the ambiguity could lead to real UB (not just unspecified order) with modern compilers when the values differ.
-
For example one code path might assume the first value was stored and the other assume the second, leading to ballooning contradictions.
End of conversation
New conversation -
-
-
Twice, if you’re talking in the context of C.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.