Re: [patch] const_cast to be replaced by str_unconst

On Tuesday, April 12, 2005 at 20:16, Roland Illig wrote:
> >>   char *str_unconst(const char *);
> >In what way is this function (or macro) useful? It seems to break the
> >whole point with 'const' in C. If something is const, you shouldn't
> >touch it. Or should you?
> We are using SLang and Samba, which both don't know about the "const" 
> qualifier. The function is meant for exactly these cases, which I hope 
> will disappear in the next future. But that's only a dream. :)
> in vfs/samba/include/smb.h, line 72, you can find:
>     int Debug1 (char *, ...);
> in slang/include/slang.h, line 155:
>     extern char *SLmemcpy (char *, char *, int);

Ah I see. I've come across that problem in other libraries as well
(libupnp for another application). If it only was easy to fix the
source of the problem (the function prototypes in those libraries!),
but unfortunately it isn't always...


Oskar Liljeblad (oskar osk mine nu)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]