From: Wei Liu Date: Mon, 23 Jul 2018 10:26:49 +0000 (+0100) Subject: ocaml: remove undefined behaviour in systemd_stubs.c X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3559 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6e2a53afa15422ee290663dbb798c085ef7068ed;p=xen.git ocaml: remove undefined behaviour in systemd_stubs.c Clang complains: systemd_stubs.c:51:8: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value] ret = Val_int(-1U); ^~~~~~~~~~~~ Since sd_notify_fd has a signature of unit -> unit, we simply change the return value to Val_unit. Signed-off-by: Wei Liu Acked-by: Christian Lindig Acked-by: Andrew Cooper --- diff --git a/tools/ocaml/xenstored/systemd_stubs.c b/tools/ocaml/xenstored/systemd_stubs.c index 490156c06a..31a1a5d384 100644 --- a/tools/ocaml/xenstored/systemd_stubs.c +++ b/tools/ocaml/xenstored/systemd_stubs.c @@ -32,13 +32,10 @@ CAMLprim value ocaml_sd_notify_ready(value ignore) { CAMLparam1(ignore); - CAMLlocal1(ret); - - ret = Val_int(0); sd_notify(1, "READY=1"); - CAMLreturn(ret); + CAMLreturn(Val_unit); } #else @@ -46,10 +43,7 @@ CAMLprim value ocaml_sd_notify_ready(value ignore) CAMLprim value ocaml_sd_notify_ready(value ignore) { CAMLparam1(ignore); - CAMLlocal1(ret); - - ret = Val_int(-1U); - CAMLreturn(ret); + CAMLreturn(Val_unit); } #endif