%% Ben Laurie <[EMAIL PROTECTED]> writes:
>> Are you saying you just don't use const, or that you provide two
>> different functions or two interfaces to the same function?
bl> The latter.
To me, that's much more ugly than simply casting it.
This is C, not C++, and we do the best we can with what we have--but
making two API's is not the right way to go.
Maybe for BN, where (IIRC) you're just talking about one function and
that function really _does_ write to the memory, it makes sense.
For things like lhash, I vote "nay".
bl> The problem is that people modify something to be const and miss
bl> the fact that it got dropped by a library function, and so modify
bl> it. This is a PITA.
IME, this rarely happens and is pretty straightforward to detect.
>> If I'm missing something maybe you could provide an actual example of
>> what you mean, say using the crypto/lhash/lhash.c:lh_insert() function.
bl> In the case of lhash the solution is tedious: provide two versions of
bl> the entire API, one for const data, one not. Whether this is worth the
bl> effort is debatable.
It's worse than that: you have to provide two different data structures
internally. Unless you're going to cast internally, and if so why
bother to have two API's anyway? It quickly reaches the point of
ridiculousness :).
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> HASMAT--HA Software Methods & Tools
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]