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