diff --git a/0001-Remove-unused-not_supported-function.patch b/0001-Remove-unused-not_supported-function.patch new file mode 100644 index 0000000..851385c --- /dev/null +++ b/0001-Remove-unused-not_supported-function.patch @@ -0,0 +1,57 @@ +From 8853f5a49587f00a7d2a5c8c7e52480a16bbdb02 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 5 Feb 2016 16:28:34 +0000 +Subject: [PATCH] Remove unused 'not_supported' function. + +Found by compiling under GCC 6. The warning was: + +In file included from libvirt_c.c:2058:0: +libvirt_c_epilogue.c:89:1: error: 'not_supported' defined but not used [-Werror=unused-function] + not_supported (const char *fn) + ^~~~~~~~~~~~~ +--- + libvirt/libvirt_c_epilogue.c | 15 --------------- + libvirt/libvirt_c_prologue.c | 1 - + 2 files changed, 16 deletions(-) + +diff --git a/libvirt/libvirt_c_epilogue.c b/libvirt/libvirt_c_epilogue.c +index 4972e50..fa592c9 100644 +--- a/libvirt/libvirt_c_epilogue.c ++++ b/libvirt/libvirt_c_epilogue.c +@@ -84,21 +84,6 @@ _raise_virterror (const char *fn) + (void) caml__frame; + } + +-/* Raise an error if a function is not supported. */ +-static void +-not_supported (const char *fn) +-{ +- CAMLparam0 (); +- CAMLlocal1 (fnv); +- +- fnv = caml_copy_string (fn); +- caml_raise_with_arg (*caml_named_value ("ocaml_libvirt_not_supported"), fnv); +- +- /*NOTREACHED*/ +- /* Suppresses a compiler warning. */ +- (void) caml__frame; +-} +- + /* Convert the virErrorNumber, virErrorDomain and virErrorLevel enums + * into values (longs because they are variants in OCaml). + * +diff --git a/libvirt/libvirt_c_prologue.c b/libvirt/libvirt_c_prologue.c +index bf972e9..710c0d6 100644 +--- a/libvirt/libvirt_c_prologue.c ++++ b/libvirt/libvirt_c_prologue.c +@@ -25,7 +25,6 @@ typedef value (*Val_ptr_t) (void *); + static value Val_opt (void *ptr, Val_ptr_t Val_ptr); + /*static value option_default (value option, value deflt);*/ + static void _raise_virterror (const char *fn) Noreturn; +-static void not_supported (const char *fn) Noreturn; + static value Val_virterror (virErrorPtr err); + + /* Use this around synchronous libvirt API calls to release the OCaml +-- +2.5.0 + diff --git a/ocaml-libvirt.spec b/ocaml-libvirt.spec index cfbbfbb..1e13d5a 100644 --- a/ocaml-libvirt.spec +++ b/ocaml-libvirt.spec @@ -2,7 +2,7 @@ Name: ocaml-libvirt Version: 0.6.1.4 -Release: 11%{?dist} +Release: 12%{?dist} Summary: OCaml binding for libvirt License: LGPLv2+ @@ -19,6 +19,8 @@ Patch2: 0001-Add-a-binding-for-virDomainCreateXML.patch Patch3: 0001-Suppress-errors-to-stderr-and-use-thread-local-virEr.patch Patch4: 0002-Don-t-bother-checking-return-from-virInitialize.patch +# Upstream patch to remove unused function. +Patch5: 0001-Remove-unused-not_supported-function.patch BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-ocamldoc @@ -50,6 +52,7 @@ developing applications that use %{name}. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build @@ -97,6 +100,9 @@ make install-byte %changelog +* Fri Feb 05 2016 Richard W.M. Jones - 0.6.1.4-12 +- Add upstream patch to remove unused function. + * Thu Feb 04 2016 Fedora Release Engineering - 0.6.1.4-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild