From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] how to avoid a memset() optimization From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 12 Nov 2002 20:47:41 -0500 Topicbox-Message-UUID: 1c6170de-eacb-11e9-9e20-41e7f4b1d025 > Putting aside issues with optimizing compilers, I don't see a "volatile" > qualifier as something that "hurts readability and clarity", I even > would say, that it is exactly the case where its use is justified. > Wouldn't you agree ? My problem with volatile is that it means ``something weird is going on here'' but doesn't tell you what. It's also not near the weirdness. Using smemset says ``this is a security-critical memset; it cannot get optimized away.'' Otherwise I just see a memset of a buffer that happens to be volatile. What does that tell me? Very little. And the volatile tag might be miles away from the memset call, making it even easier to forget that they're related. > You're right here, but for me defining secmemset is much bigger evil > than just adding volatile to the buffer. Why?