aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-libvirt/0001-Use-g-warn-error.patch
blob: 7c6bf35a54af4680fc5ef8c432158a1cf1f27fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 2ba6898b4dc121b00078e36d5416b3caadd5d05e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
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