On Sat, 23 Nov 2002 08:11:58 -0500 (EST), Rich Salz wrote: >My code had a bug. check_memset should be this:
>void checkmem(const char* cp, int i) >{ >for (; --i >= 0; cp++) { >assert(*cp = '\0'); >if (*cp) abort(); >} >} >>This may work for now, but nothing in the spec forbids this from being >>optimised out in, say the next release of the compiler. Would it not be >>more dangerous to be lulled into a false sense of security? >The above cannot be optimized out, and forces the memset calls to not >be optimized out. >/r$ Do you have some proof or argument that it can't be optimized out? I beileve that under the 'as if' rule, a sufficiently smart compiler could optimize this out. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]