From patchwork Fri Oct 25 23:21:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petre Ovidiu PIRCALABU X-Patchwork-Id: 11213205 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0599414E5 for ; Fri, 25 Oct 2019 23:23:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC26720867 for ; Fri, 25 Oct 2019 23:23:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC26720867 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bitdefender.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iO8tP-00074x-IV; Fri, 25 Oct 2019 23:21:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iO8tO-00074s-D2 for xen-devel@lists.xenproject.org; Fri, 25 Oct 2019 23:21:14 +0000 X-Inumbo-ID: 2238841a-f77e-11e9-beca-bc764e2007e4 Received: from mx01.bbu.dsd.mx.bitdefender.com (unknown [91.199.104.161]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2238841a-f77e-11e9-beca-bc764e2007e4; Fri, 25 Oct 2019 23:21:13 +0000 (UTC) Received: from smtp.bitdefender.com (smtp02.buh.bitdefender.net [10.17.80.76]) by mx01.bbu.dsd.mx.bitdefender.com (Postfix) with ESMTPS id C68C0306E47C; Sat, 26 Oct 2019 02:21:11 +0300 (EEST) Received: from bitdefender.com (unknown [195.189.155.70]) by smtp.bitdefender.com (Postfix) with ESMTPSA id A8B57303442B; Sat, 26 Oct 2019 02:21:11 +0300 (EEST) From: Petre Pircalabu To: xen-devel@lists.xenproject.org Date: Sat, 26 Oct 2019 02:21:10 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/ocaml: Fix build error with Arch Linux X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Petre Pircalabu , Ian Jackson , Christian Lindig , Wei Liu , David Scott Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" gcc (GCC) 9.2.0 complains: xentoollog_stubs.c: In function ‘stub_xtl_ocaml_vmessage’: xentoollog_stubs.c:93:16: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 93 | value *func = caml_named_value(xtl->vmessage_cb) ; | ^~~~~~~~~~~~~~~~ Signed-off-by: Petre Pircalabu Reviewed-by: Anthony PERARD --- tools/ocaml/libs/xentoollog/xentoollog_stubs.c | 4 ++-- tools/ocaml/libs/xl/xenlight_stubs.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c index aadc3d1..1f73f26 100644 --- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c +++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c @@ -90,7 +90,7 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger, CAMLparam0(); CAMLlocalN(args, 4); struct caml_xtl *xtl = (struct caml_xtl*)logger; - value *func = caml_named_value(xtl->vmessage_cb) ; + const value *func = caml_named_value(xtl->vmessage_cb) ; char *msg; if (func == NULL) @@ -120,7 +120,7 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger, CAMLparam0(); CAMLlocalN(args, 5); struct caml_xtl *xtl = (struct caml_xtl*)logger; - value *func = caml_named_value(xtl->progress_cb) ; + const value *func = caml_named_value(xtl->progress_cb) ; if (func == NULL) caml_raise_sys_error(caml_copy_string("Unable to find callback")); diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c index ff16b87..1181971 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -75,7 +75,7 @@ static void failwith_xl(int error, char *fname) { CAMLparam0(); CAMLlocal1(arg); - static value *exc = NULL; + static const value *exc = NULL; /* First time around, lookup by name */ if (!exc) @@ -424,7 +424,7 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback) caml_leave_blocking_section(); CAMLparam0(); CAMLlocal2(error, tmp); - static value *func = NULL; + static const value *func = NULL; value *p = (value *) for_callback; if (func == NULL) { @@ -1133,7 +1133,7 @@ value stub_libxl_xen_console_read_start(value ctx, value clear) static void raise_eof(void) { - static value *exc = NULL; + static const value *exc = NULL; /* First time around, lookup by name */ if (!exc) @@ -1274,7 +1274,7 @@ int fd_register(void *user, int fd, void **for_app_registration_out, CAMLparam0(); CAMLlocalN(args, 4); int ret = 0; - static value *func = NULL; + static const value *func = NULL; value *p = (value *) user; value *for_app; @@ -1317,7 +1317,7 @@ int fd_modify(void *user, int fd, void **for_app_registration_update, CAMLparam0(); CAMLlocalN(args, 4); int ret = 0; - static value *func = NULL; + static const value *func = NULL; value *p = (value *) user; value *for_app = *for_app_registration_update; @@ -1356,7 +1356,7 @@ void fd_deregister(void *user, int fd, void *for_app_registration) caml_leave_blocking_section(); CAMLparam0(); CAMLlocalN(args, 3); - static value *func = NULL; + static const value *func = NULL; value *p = (value *) user; value *for_app = for_app_registration; @@ -1398,7 +1398,7 @@ int timeout_register(void *user, void **for_app_registration_out, CAMLlocal2(sec, usec); CAMLlocalN(args, 4); int ret = 0; - static value *func = NULL; + static const value *func = NULL; value *p = (value *) user; struct timeout_handles *handles; @@ -1450,7 +1450,7 @@ int timeout_modify(void *user, void **for_app_registration_update, CAMLlocal1(for_app_update); CAMLlocalN(args, 2); int ret = 0; - static value *func = NULL; + static const value *func = NULL; value *p = (value *) user; struct timeout_handles *handles = *for_app_registration_update; @@ -1566,7 +1566,7 @@ void event_occurs(void *user, libxl_event *event) CAMLparam0(); CAMLlocalN(args, 2); struct user_with_ctx *c_user = (struct user_with_ctx *) user; - static value *func = NULL; + static const value *func = NULL; if (func == NULL) { /* First time around, lookup by name */ @@ -1589,7 +1589,7 @@ void disaster(void *user, libxl_event_type type, CAMLparam0(); CAMLlocalN(args, 4); struct user_with_ctx *c_user = (struct user_with_ctx *) user; - static value *func = NULL; + static const value *func = NULL; if (func == NULL) { /* First time around, lookup by name */