On Mon, Jun 17, 2002 at 07:02:45PM +0100, Ben Laurie wrote: > Avery Pennarun via RT wrote: >> On Mon, Jun 17, 2002 at 11:19:31AM +0200, Bodo Moeller wrote:
>>> Good question, but this problem does not appear to apply to C, and >>> anyway it only makes *existing* code uglier -- for new code, the >>> modified API makes more sense (the encoded data can be in >>> 'const unsigned char' arrays all the time). If you don't want #ifdefs >>> and casts throughout your code, please consider hiding this in wrapper >>> functions. >> Hmm, okay, I'm not really convinced, but now that I see it doesn't cause C >> programs to not compile, I think it's okay to accept the small number of >> openssl-using C++ programs that will need changes because of this. > Hmm, well, I'm not, because all right-thinking projects have a > zero-warnings policy. OpenSSL included. The old API is not perfect when the data is located in a 'const' array, the new API is not perfect when the data is located in a non-'const' array. C++ code can be written to match either the old or the new API; with the wrong API, you can have either zero warnings or zero casts, not both. As those functions are not really supposed to modify the data, the 'const' variant appears to be the right one. -- Bodo M�ller <[EMAIL PROTECTED]> PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html * TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt * Tel. +49-6151-16-6628, Fax +49-6151-16-6036 ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
