[patch] const_cast to be replaced by str_unconst

Oskar Liljeblad oskar at osk.mine.nu
Tue Apr 12 14:16:26 UTC 2005


On Tuesday, April 12, 2005 at 12:27, Roland Illig wrote:

Hi!

> I'd like to introduce a new function:
> 
>     char *str_unconst(const char *);
> 
> The function returns a string that compares equal to its argument, but 
> does not have the "const" qualifier. Currently it just returns its 
> argument, cast to (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?

Regards,

Oskar Liljeblad (oskar at osk.mine.nu)



More information about the mc-devel mailing list