[Python-Dev] warning in _localemodule.c patch

Jeremy Hylton jeremy@zope.com
Fri, 7 Sep 2001 12:15:57 -0400 (EDT)


The most recent revision (2.23) adds some code that modifies
Py_FileSystemDefaultEncoding.  This variable is decarled const char *
in bltinmodule.c, but passed to free() in the new localmodule.
gcc warns about this: 'free' discards qualifiers from pointer target
type.  You can't free the memory Py_FSDE points to, since it wasn't
allocated by malloc().

I guess the simple solution is to remove the const.  Is there a better
option?

Jeremy