Old Wolf wrote:
The compilers are are throwing away the function
because the result is not used.
Perhaps the only way to future-proof against optimisations
is to ensure it IS used: write the cleared buffer to /dev/null.
In this scenario, what's to stop the compiler not clearing the memory and
stuffing new zeroes into your pipe to /dev/null or whatever?
OK, you read from /dev/zero to write over the buffer.
Or better yet, /dev/random.
So, now the data for the buffer is coming and going
to and from sources and destinations external
to the running program.
Let's see a compiler optimise THAT out.
Matt
who is waiting for machine global optimisers :-)
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]