[Pkg-libvirt-commits] [libguestfs] 181/266: Enable warnings in C code linked to virt-sparsify and virt-v2v.
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:41:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.
commit 3f315f54e80f449d9fd7b05eafa1c23996775d02
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue Aug 26 16:01:39 2014 +0100
Enable warnings in C code linked to virt-sparsify and virt-v2v.
The C code didn't have -Werror enabled (when configured) and didn't
enable the full set of warnings we would want.
However OCaml-C bindings commonly declare functions which are
called directly from OCaml, eg:
external parse_memory : string -> doc = "v2v_xml_parse_memory"
value v2v_xml_parse_memory (value xmlv)
These do not require prototypes as no other C code will call them, so
we have to switch off the GCC -Werror=missing-prototypes flag for
these files.
Also fixes some confusion between _CPPFLAGS and _CFLAGS.
---
customize/crypt-c.c | 2 ++
mllib/mkdtemp-c.c | 2 ++
mllib/progress-c.c | 2 ++
mllib/tty-c.c | 2 ++
sparsify/Makefile.am | 4 +++-
sparsify/statvfs-c.c | 2 ++
v2v/Makefile.am | 6 ++++--
v2v/utils-c.c | 2 ++
v2v/xml-c.c | 2 ++
9 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/customize/crypt-c.c b/customize/crypt-c.c
index 29a91e4..ecc5701 100644
--- a/customize/crypt-c.c
+++ b/customize/crypt-c.c
@@ -26,6 +26,8 @@
#include <caml/memory.h>
#include <caml/mlvalues.h>
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
value
virt_sysprep_crypt (value keyv, value saltv)
{
diff --git a/mllib/mkdtemp-c.c b/mllib/mkdtemp-c.c
index 2284e3a..c9a84c0 100644
--- a/mllib/mkdtemp-c.c
+++ b/mllib/mkdtemp-c.c
@@ -34,6 +34,8 @@
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
value
virt_builder_mkdtemp (value val_pattern)
{
diff --git a/mllib/progress-c.c b/mllib/progress-c.c
index 6d777b6..70eb47e 100644
--- a/mllib/progress-c.c
+++ b/mllib/progress-c.c
@@ -33,6 +33,8 @@
#include "progress.h"
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
#define Bar_val(v) (*((struct progress_bar **)Data_custom_val(v)))
static void
diff --git a/mllib/tty-c.c b/mllib/tty-c.c
index 64fa884..369b647 100644
--- a/mllib/tty-c.c
+++ b/mllib/tty-c.c
@@ -25,6 +25,8 @@
#include <caml/memory.h>
#include <caml/mlvalues.h>
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
/* RHEL 5-era ocaml didn't have Unix.isatty.
*
* Note this function is marked as "noalloc" so it must not call any
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index 3dde57b..bb3bda0 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -42,12 +42,14 @@ if HAVE_OCAML
bin_PROGRAMS = virt-sparsify
virt_sparsify_SOURCES = $(SOURCES_C)
-virt_sparsify_CFLAGS = \
+virt_sparsify_CPPFLAGS = \
-I. \
-I$(top_builddir) \
-I$(shell $(OCAMLC) -where) \
-I$(top_srcdir)/src \
-I$(top_srcdir)/fish
+virt_sparsify_CFLAGS = \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS)
BOBJECTS = \
$(top_builddir)/mllib/common_gettext.cmo \
diff --git a/sparsify/statvfs-c.c b/sparsify/statvfs-c.c
index ce72d5b..2ad8db3 100644
--- a/sparsify/statvfs-c.c
+++ b/sparsify/statvfs-c.c
@@ -27,6 +27,8 @@
#include <caml/memory.h>
#include <caml/mlvalues.h>
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
value
virt_sparsify_statvfs_free_space (value pathv)
{
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index b984073..a336ee8 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -72,12 +72,14 @@ if HAVE_OCAML
bin_PROGRAMS = virt-v2v
virt_v2v_SOURCES = $(SOURCES_C)
-virt_v2v_CFLAGS = \
+virt_v2v_CPPFLAGS = \
-I. \
-I$(top_builddir) \
-I$(shell $(OCAMLC) -where) \
-I$(top_srcdir)/src \
- -I$(top_srcdir)/fish \
+ -I$(top_srcdir)/fish
+virt_v2v_CFLAGS = \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS) \
$(LIBXML2_CFLAGS)
BOBJECTS = \
diff --git a/v2v/utils-c.c b/v2v/utils-c.c
index f6a5d74..8be5150 100644
--- a/v2v/utils-c.c
+++ b/v2v/utils-c.c
@@ -29,6 +29,8 @@
#include "guestfs.h"
#include "guestfs-internal-frontend.h"
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
value
v2v_utils_drive_name (value indexv)
{
diff --git a/v2v/xml-c.c b/v2v/xml-c.c
index 4c9bc77..e6e7d16 100644
--- a/v2v/xml-c.c
+++ b/v2v/xml-c.c
@@ -36,6 +36,8 @@
#include "guestfs.h"
#include "guestfs-internal-frontend.h"
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+
/* xmlDocPtr type */
#define Doc_val(v) (*((xmlDocPtr *)Data_custom_val(v)))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list