3 ms·
I was referring to the first sentence ("It is a little mind boggling that support for proper handling of this didn't arrive until c11."). I don't see anything
by maxlybbert 12y ago
I was referring to the first sentence ("It is a little mind boggling that support for proper handling of this didn't arrive until c11."). I don't see anything C11-specific in the code Percival posted. I don't know enough to say anything useful about the rest of your comment.
- e12e 12y agoMy point was that this dance around "observed behaviour" isn't needed in C11, as per: "(...) on C11 (are there any fully C11-compliant platforms yet?) you can use the memset_s function. (...) [which is] guaranteed (or at least specified) to write the provided buffer and to not be optimized away." On another note, searching for memset_s and openbsd yielded this hit from 2012: https://mail-index.netbsd.org/tech-security/2012/07/22/msg000540.html https://mail-index.netbsd.org/tech-security/2012/07/22/msg00... Which seems to point back to: https://mail-index.netbsd.org/tech-userlevel/2012/02/25/msg006157.html https://mail-index.netbsd.org/tech-userlevel/2012/02/25/msg0... So I guess the "trick" outlined in the (very lucid) post has been known for a while.
- maxlybbert 12y agoThanks. I had missed the part in the article about the C11 changes.