—Are you going to suggest memset_s()?
—I don't know, it's only 2016, perhaps volatile…
cc @BRIAN_____
-
-
@BRIAN_____ it has existed for longer. memset_s was only standardized in C11 and arguments can be made it was the wrong approach anyway.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@BRIAN_____ @spun_off I'd generally trust the pointer-to-volatile code, the GCC/LLVM folks have worked really hard to fix volatile bugs -
@johnregehr @spun_off AFAICT, the compiler is allowed to recognize when the pointed-at thing isn't actually volatile. That makes me nervous. -
@BRIAN_____ When lv is volatile in “lv = …;”, it means that the write is an observable side-effect and must happen in correct order wrt … -
@BRIAN_____ other observable side-effects. It does not matter one bit that lv is “*(volatile t) &nonvol_var”. Must still happen. -
@BRIAN_____ We could get philosophical about what the address of an automatic variable is, but that's orthogonal to “volatile” really. -
@spun_off
@BRIAN_____ C/C++ have wonderful "as if" rule: can optimize proven you can't tell the difference without relying on UB. -
@jfbastien I don't know what clause of the C11 standard you are referring to, and regardless this is a terrible explanation. -
@jfbastien If the standard said that something were observable behavior, such an as-if rule would mean that it has to be preserved. - 7 more replies
New conversation -
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.