ca920e
From 2ba6898b4dc121b00078e36d5416b3caadd5d05e Mon Sep 17 00:00:00 2001
ca920e
From: "Richard W.M. Jones" <rjones@redhat.com>
ca920e
Date: Mon, 27 Mar 2017 14:12:50 +0100
ca920e
Subject: [PATCH 1/5] Use -g -warn-error.
ca920e
ca920e
Use -g for ocamlopt.  ocamlopt has supported generating DWARF
ca920e
information for quite a long time.
ca920e
ca920e
Also use -warn-error with the same set of warnings as is used
ca920e
by libguestfs.
ca920e
ca920e
Fix a warning in examples/get_cpu_stats.ml found by enabling
ca920e
-warn-error.
ca920e
---
ca920e
 examples/Makefile.in      | 4 ++--
ca920e
 examples/get_cpu_stats.ml | 2 ++
ca920e
 libvirt/Makefile.in       | 6 +++---
ca920e
 3 files changed, 7 insertions(+), 5 deletions(-)
ca920e
ca920e
diff --git a/examples/Makefile.in b/examples/Makefile.in
ca920e
index 041e382..46006a0 100644
ca920e
--- a/examples/Makefile.in
ca920e
+++ b/examples/Makefile.in
ca920e
@@ -18,10 +18,10 @@
ca920e
 OCAMLFIND	= @OCAMLFIND@
ca920e
 
ca920e
 OCAMLCPACKAGES	:= -package unix -I ../libvirt
ca920e
-OCAMLCFLAGS	:= -g
ca920e
+OCAMLCFLAGS	:= -g -warn-error CDEFLMPSUVYZX-3
ca920e
 OCAMLCLIBS	:= -linkpkg
ca920e
 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
ca920e
-OCAMLOPTFLAGS	:=
ca920e
+OCAMLOPTFLAGS	:= -g -warn-error CDEFLMPSUVYZX-3
ca920e
 OCAMLOPTLIBS	:= $(OCAMLCLIBS)
ca920e
 
ca920e
 export LIBRARY_PATH=../libvirt
ca920e
diff --git a/examples/get_cpu_stats.ml b/examples/get_cpu_stats.ml
ca920e
index d7a8d0c..814c85e 100644
ca920e
--- a/examples/get_cpu_stats.ml
ca920e
+++ b/examples/get_cpu_stats.ml
ca920e
@@ -19,9 +19,11 @@ let () =
ca920e
 
ca920e
     let conn = C.connect_readonly () in
ca920e
 
ca920e
+    (*
ca920e
     let nr_pcpus =
ca920e
       let info = C.get_node_info conn in
ca920e
       C.maxcpus_of_node_info info in
ca920e
+     *)
ca920e
 
ca920e
     let stats =
ca920e
       let dom = D.lookup_by_name conn domname in
ca920e
diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in
ca920e
index f7c04bb..cf614fc 100644
ca920e
--- a/libvirt/Makefile.in
ca920e
+++ b/libvirt/Makefile.in
ca920e
@@ -31,15 +31,15 @@ OCAMLMKLIB	= @OCAMLMKLIB@
ca920e
 
ca920e
 ifneq ($(OCAMLFIND),)
ca920e
 OCAMLCPACKAGES	:= -package unix
ca920e
-OCAMLCFLAGS	:= -g
ca920e
+OCAMLCFLAGS	:= -g -warn-error CDEFLMPSUVYZX-3
ca920e
 OCAMLCLIBS	:= -linkpkg
ca920e
 else
ca920e
 OCAMLCINCS	:=
ca920e
-OCAMLCFLAGS	:= -g
ca920e
+OCAMLCFLAGS	:= -g -warn-error CDEFLMPSUVYZX-3
ca920e
 OCAMLCLIBS	:= unix.cma
ca920e
 endif
ca920e
 
ca920e
-OCAMLOPTFLAGS	:=
ca920e
+OCAMLOPTFLAGS	:= $(OCAMLCFLAGS)
ca920e
 ifneq ($(OCAMLFIND),)
ca920e
 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
ca920e
 OCAMLOPTLIBS	:= $(OCAMLCLIBS)
ca920e
-- 
ca920e
2.9.3
ca920e