#3780 PYTHON: Avoid warnings with python3.7
Merged 5 years ago by jhrozek. Opened 5 years ago by lslebodn.
SSSD/ lslebodn/sssd python37  into  master

file modified
+1 -1
@@ -232,7 +232,7 @@ 

      Py_ssize_t i;

      PyObject *item;

      char *s = NULL;

-     char *part;

+     const char *part;

  

      size = PySequence_Size(seq);

  

file modified
+1 -1
@@ -45,7 +45,7 @@ 

  

      ret = talloc_array(mem_ctx, char *, PyList_Size(list)+1);

      for (i = 0; i < PyList_Size(list); i++) {

-         char *itemstr;

+         const char *itemstr;

          Py_ssize_t itemlen;

          PyObject *item = PyList_GetItem(list, i);

  #ifdef IS_PY3K

src/python/pysss.c: In function 'PyList_AsStringList':
src/python/pysss.c:60:17: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
itemstr = PyUnicode_AsUTF8AndSize(item, &itemlen);
^

src/python/pyhbac.c: In function 'str_concat_sequence':
src/python/pyhbac.c:252:14: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
part = PyUnicode_AsUTF8(item);
^

The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8() is now
of type const char * rather of char *. (Contributed by Serhiy
Storchaka in bpo-28769.)

https://docs.python.org/3.7/whatsnew/3.7.html
https://bugs.python.org/issue28769

rebased onto 3c5d4a8

5 years ago

Commit 2a3f249 fixes this pull-request

Pull-Request has been merged by jhrozek

5 years ago
Metadata