[Python-bugs-list] [ python-Bugs-460838 ] compilation warning from missing cast

noreply@sourceforge.net noreply@sourceforge.net
Sun, 23 Sep 2001 03:30:51 -0700


Bugs item #460838, was opened at 2001-09-12 01:09
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470

Category: Extension Modules
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Andrew Dalke (dalke)
Assigned to: Martin v. Löwis (loewis)
Summary: compilation warning from missing cast

Initial Comment:
When compiling _localemodule.c under IRIX I get the
warning

"/usr2/people/dalke/cvses/python/dist/src/Modules/_loca
lemodule.c", line 218: warning(1164):
          argument of type "const char *" is
incompatible with parameter of
          type "void *"
             free (Py_FileSystemDefaultEncoding);

There should be a cast throwing constness away
to get rid of that warning.

Here's a patch that doesn't have the warning

Index: Modules/_localemodule.c
=======================================================
============
RCS 
file: /cvsroot/python/python/dist/src/Modules/_localemo
dule.c,v
retrieving revision 2.23
diff -c -r2.23 _localemodule.c
*** Modules/_localemodule.c     2001/09/05 
17:09:48     2.23
--- Modules/_localemodule.c     2001/09/12 08:04:25
***************
*** 215,221 ****
            if (*codeset && (enc = PyCodec_Encoder
(codeset))) {
                /* Release previous file encoding */
                if (Py_FileSystemDefaultEncoding)
!                   free 
(Py_FileSystemDefaultEncoding);
                Py_FileSystemDefaultEncoding = strdup
(codeset);
                Py_DECREF(enc);
            } else
--- 215,221 ----
            if (*codeset && (enc = PyCodec_Encoder
(codeset))) {
                /* Release previous file encoding */
                if (Py_FileSystemDefaultEncoding)
!                   free ((char *)
Py_FileSystemDefaultEncoding);
                Py_FileSystemDefaultEncoding = strdup
(codeset);
                Py_DECREF(enc);
            } else

                          Andrew




----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-09-23 03:30

Message:
Logged In: YES 
user_id=21627

This is fixed in 2.24 of _localemodule.c.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460838&group_id=5470