[libvirt] [PATCH] Fix GCC hard-coding in python/

# HG changeset patch # User john.levon@sun.com # Date 1229399267 28800 # Node ID b105e5a7cd6190e0b952a1587d7e80f39d02e63c # Parent 35512df785342cd15214790e17e0c1f4d2182b32 Fix GCC hard-coding in python/ Signed-off-by: John Levon <john.levon@sun.com> diff --git a/acinclude.m4 b/acinclude.m4 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -75,6 +75,11 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS" AC_SUBST(WARN_CFLAGS) + + COMPILER_FLAGS= + gl_COMPILER_FLAGS(-Wno-redundant-decls) + NO_RDECLS_CFLAGS=$COMPILER_FLAGS + AC_SUBST(NO_RDECLS_CFLAGS) ]) diff --git a/python/Makefile.am b/python/Makefile.am --- a/python/Makefile.am +++ b/python/Makefile.am @@ -35,7 +35,7 @@ python_LTLIBRARIES = libvirtmod.la libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h # Python header files contain a redundant decl, hence: -libvirtmod_la_CFLAGS = -Wno-redundant-decls +libvirtmod_la_CFLAGS = @NO_RDECLS_CFLAGS@ libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs \ @CYGWIN_EXTRA_LDFLAGS@

john.levon@sun.com wrote:
Fix GCC hard-coding in python/ ... diff --git a/acinclude.m4 b/acinclude.m4 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -75,6 +75,11 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS" AC_SUBST(WARN_CFLAGS) + + COMPILER_FLAGS= + gl_COMPILER_FLAGS(-Wno-redundant-decls) + NO_RDECLS_CFLAGS=$COMPILER_FLAGS + AC_SUBST(NO_RDECLS_CFLAGS) ])
diff --git a/python/Makefile.am b/python/Makefile.am --- a/python/Makefile.am +++ b/python/Makefile.am @@ -35,7 +35,7 @@ python_LTLIBRARIES = libvirtmod.la
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h # Python header files contain a redundant decl, hence: -libvirtmod_la_CFLAGS = -Wno-redundant-decls +libvirtmod_la_CFLAGS = @NO_RDECLS_CFLAGS@
That -Wno-redundant-decls option is no longer necessary, at least on rawhide. When I remove it, compiling with "make -C python CFLAGS='-Wredundant-decls -Werror'" still succeeds. So how about simply removing it? That also avoids adding the relatively distant python/Makefile.am -> acinclude.m4 dependency.

On Wed, Dec 17, 2008 at 09:57:23AM +0100, Jim Meyering wrote:
john.levon@sun.com wrote:
Fix GCC hard-coding in python/ ... diff --git a/acinclude.m4 b/acinclude.m4 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -75,6 +75,11 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS" AC_SUBST(WARN_CFLAGS) + + COMPILER_FLAGS= + gl_COMPILER_FLAGS(-Wno-redundant-decls) + NO_RDECLS_CFLAGS=$COMPILER_FLAGS + AC_SUBST(NO_RDECLS_CFLAGS) ])
diff --git a/python/Makefile.am b/python/Makefile.am --- a/python/Makefile.am +++ b/python/Makefile.am @@ -35,7 +35,7 @@ python_LTLIBRARIES = libvirtmod.la
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h # Python header files contain a redundant decl, hence: -libvirtmod_la_CFLAGS = -Wno-redundant-decls +libvirtmod_la_CFLAGS = @NO_RDECLS_CFLAGS@
That -Wno-redundant-decls option is no longer necessary, at least on rawhide. When I remove it, compiling with "make -C python CFLAGS='-Wredundant-decls -Werror'" still succeeds.
What about with older RHEL-5 python though ? Python 2.4 had rather a large number of flaws in its public header file that have caused plenty of compile warning problems in past. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

"Daniel P. Berrange" <berrange@redhat.com> wrote:
On Wed, Dec 17, 2008 at 09:57:23AM +0100, Jim Meyering wrote:
john.levon@sun.com wrote:
Fix GCC hard-coding in python/ ... diff --git a/acinclude.m4 b/acinclude.m4 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -75,6 +75,11 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS" AC_SUBST(WARN_CFLAGS) + + COMPILER_FLAGS= + gl_COMPILER_FLAGS(-Wno-redundant-decls) + NO_RDECLS_CFLAGS=$COMPILER_FLAGS + AC_SUBST(NO_RDECLS_CFLAGS) ])
diff --git a/python/Makefile.am b/python/Makefile.am --- a/python/Makefile.am +++ b/python/Makefile.am @@ -35,7 +35,7 @@ python_LTLIBRARIES = libvirtmod.la
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h # Python header files contain a redundant decl, hence: -libvirtmod_la_CFLAGS = -Wno-redundant-decls +libvirtmod_la_CFLAGS = @NO_RDECLS_CFLAGS@
That -Wno-redundant-decls option is no longer necessary, at least on rawhide. When I remove it, compiling with "make -C python CFLAGS='-Wredundant-decls -Werror'" still succeeds.
What about with older RHEL-5 python though ? Python 2.4 had rather a large number of flaws in its public header file that have caused plenty of compile warning problems in past.
It's no trouble for me either way. I find that it is a losing battle to try to enable aggressive compiler warnings on older systems, but don't feel strongly about this particular case. I mentioned it because there are new gcc-warning-related macros in gnulib, and it'd be slightly easier to use them if the ones libvirt uses don't have tendrils reaching into relatively distant Makefile.am files.

On Wed, Dec 17, 2008 at 11:15:30AM +0000, Daniel P. Berrange wrote:
On Wed, Dec 17, 2008 at 09:57:23AM +0100, Jim Meyering wrote:
john.levon@sun.com wrote:
Fix GCC hard-coding in python/ ... diff --git a/acinclude.m4 b/acinclude.m4 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -75,6 +75,11 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS" AC_SUBST(WARN_CFLAGS) + + COMPILER_FLAGS= + gl_COMPILER_FLAGS(-Wno-redundant-decls) + NO_RDECLS_CFLAGS=$COMPILER_FLAGS + AC_SUBST(NO_RDECLS_CFLAGS) ])
diff --git a/python/Makefile.am b/python/Makefile.am --- a/python/Makefile.am +++ b/python/Makefile.am @@ -35,7 +35,7 @@ python_LTLIBRARIES = libvirtmod.la
libvirtmod_la_SOURCES = libvir.c types.c libvirt-py.c libvirt-py.h # Python header files contain a redundant decl, hence: -libvirtmod_la_CFLAGS = -Wno-redundant-decls +libvirtmod_la_CFLAGS = @NO_RDECLS_CFLAGS@
That -Wno-redundant-decls option is no longer necessary, at least on rawhide. When I remove it, compiling with "make -C python CFLAGS='-Wredundant-decls -Werror'" still succeeds.
What about with older RHEL-5 python though ? Python 2.4 had rather a large number of flaws in its public header file that have caused plenty of compile warning problems in past.
I've verified this flag is still needed on RHEL-5, so will go for John's patch Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Jim Meyering
-
john.levon@sun.com