> -----Original Message-----
> From: Richard Levitte - VMS Whacker [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 07, 2000 8:55 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Constification
>
>
> From: "Paul D. Smith" <[EMAIL PROTECTED]>
>
> psmith> This is similar to standard C functions which take a const
> psmith> char*, for example, and return a char* that points into the
> psmith> string.
>
> Like strstr()...
>
> psmith> IMHO this is a legitimate reason to cast away const, and that
> psmith> the "const" notation on the arguments to lhash is useful for
> psmith> self-documentation purposes, at the least.
>
> Hmm, perhaps you're right. I'm just a bit worried about how hard it
> might become if someone is stupid enough to actually use the returned
> (non-const) pointer to change something that is on RO memory...
>
There's no alternative in C. In C++ you may use overloading as in:
extern const char* f(const char* s);
inline char* f(char* s) { return (char*)f((const char*)s); }
assuming, of course, that f returns a pointer in the passed string.
Regards,
Bernard
--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel: +33 (0) 1 47 68 80 80
Fax: +33 (0) 1 47 88 97 85
e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]
--------------------------------------------
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]