3 ms·
> Of course there is, you just use the volatile keyword. Colin Percival of FreeBSD disagrees: http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.
by dezgeg 11y ago
> Of course there is, you just use the volatile keyword.
Colin Percival of FreeBSD disagrees:
http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buf...
- TheLoneWolfling 11y agoAnd that doesn't even get into the other aspect of it: Namely that C / C++ allows temporary copies of variables that are not cleared afterwards. The most obvious case of this being things being temporarily copied into registers / stack, but there are other examples as well.
- kllrnohj 11y agoNot really. He just says if the compiler can optimize away prior to it being declared volatile.