]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add -Wno-cast-function-type for python
authorKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 08:23:51 +0000 (10:23 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 08:23:51 +0000 (10:23 +0200)
 libmount/python/pylibmount.c:158:19: warning: cast between incompatible function types
   from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’}
     to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
   [-Wcast-function-type]

This is generic problem in all Python C code and gcc v8. The another
possible (and probably more correct) way is to add unused argument to
all API functions. Unfortunately, this solution is pretty invasive. The
question is if gcc is not too paranoid in this case.

For more details see https://bugs.python.org/issue33012. It seems
Python guys also prefer CFLAGS modification for now.

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libmount/python/Makemodule.am

index b3430dac43d12b5b7ffbc8ffde9c1e854ac270dd..edef1455c190ee9ef794fd4909a66d1a5d623804 100644 (file)
@@ -139,6 +139,10 @@ AC_SUBST([WARN_CFLAGS])
 
 UL_WARN_ADD([-Wno-clobbered], [BSD_WARN_CFLAGS])
 AC_SUBST([BSD_WARN_CFLAGS])
+
+UL_WARN_ADD([-Wno-cast-function-type], [PYTHON_WARN_CFLAGS])
+AC_SUBST([PYTHON_WARN_CFLAGS])
+
 UL_WARN_ADD([-Wno-unused-parameter], [NO_UNUSED_WARN_CFLAGS])
 AC_SUBST([NO_UNUSED_WARN_CFLAGS])
 
index fb93b6e987b8122ea355e1d2d1b113326fade16c..b338ea03294b77e624670443841cd64b63e623b0 100644 (file)
@@ -21,7 +21,7 @@ pylibmount_la_LIBADD = libmount.la $(PYTHON_LIBS)
 
 pylibmount_la_CFLAGS = \
        $(AM_CFLAGS) \
-       $(PYTHON_CFLAGS) \
+       $(PYTHON_CFLAGS) $(PYTHON_WARN_CFLAGS) \
        -I$(ul_libmount_incdir) \
        -fno-strict-aliasing #-ggdb3 -O0