From nobody Tue Feb 10 04:20:19 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=bitdefender.com ARC-Seal: i=1; a=rsa-sha256; t=1572280812; cv=none; d=zoho.com; s=zohoarc; b=AD3U/+YBP3tPhRAFILbjtfitwyfCNk4gxXC4Ib5uM9rIIDXRVlmqNPssvAq7uuc8zVKT7mwBI0iGhzLTrE8HgXwPF/uPwmRM3k18KR0Zimt1P47bswSf/jkQnf/jNkjSIKwVGTTe3e9Q9nGlqDy6Z06wLin/BBN9aJVBsw68fUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572280812; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=VPxAeu+7TzHhKBeuljs80PorHD4s+Y1u1yoTLI249xY=; b=lIiQb5PSb3boqUeTgi+PyGnVBb3VJS120mXY4TGtlL/dOzDjc2Dwi467fIEVGXjniSBsPE5omj7RXwlDIA3AYW7NYQ9iN/2RtEQfbZGQRK3EuFZgDSSsJULgcQBwa+ELKkhS9NCGJ/jA34Jpsr+OV/V0nav3mk2vmDSSkSDFr8M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1572280812313816.1986946995453; Mon, 28 Oct 2019 09:40:12 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iP82c-0007yo-Vg; Mon, 28 Oct 2019 16:38:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iP82b-0007yg-Pn for xen-devel@lists.xenproject.org; Mon, 28 Oct 2019 16:38:49 +0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (unknown [91.199.104.161]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6a5b723c-f9a1-11e9-94fb-12813bfff9fa; Mon, 28 Oct 2019 16:38:48 +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 821373074839; Mon, 28 Oct 2019 18:38:47 +0200 (EET) Received: from bitdefender.com (unknown [195.189.155.70]) by smtp.bitdefender.com (Postfix) with ESMTPSA id E5008303EF07; Mon, 28 Oct 2019 18:38:46 +0200 (EET) X-Inumbo-ID: 6a5b723c-f9a1-11e9-94fb-12813bfff9fa From: Petre Pircalabu To: xen-devel@lists.xenproject.org Date: Mon, 28 Oct 2019 18:38:42 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" gcc (GCC) 9.2.0 complains: xentoollog_stubs.c: In function =E2=80=98stub_xtl_ocaml_vmessage=E2=80=99: xentoollog_stubs.c:93:16: error: initialization discards =E2=80=98const=E2= =80=99 qualifier from pointer target type [-Werror=3Ddiscarded-qualifiers] 93 | value *func =3D caml_named_value(xtl->vmessage_cb) ; | ^~~~~~~~~~~~~~~~ This patch constifies the pointer returned by caml_named_value in order to the accommodate newer versions of OCaml. In OCaml >=3D 4.09 the return value pointer of caml_named_value is declared const. https://github.com/ocaml/ocaml/commit/4f03a1467d29cf587df5a191830f1525506ee= 0e3 Signed-off-by: Petre Pircalabu Reviewed-by: Anthony PERARD Release-acked-by: Juergen Gross Acked-by: Wei Liu --- 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/l= ibs/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_log= ger *logger, CAMLparam0(); CAMLlocalN(args, 4); struct caml_xtl *xtl =3D (struct caml_xtl*)logger; - value *func =3D caml_named_value(xtl->vmessage_cb) ; + const value *func =3D caml_named_value(xtl->vmessage_cb) ; char *msg; =20 if (func =3D=3D NULL) @@ -120,7 +120,7 @@ static void stub_xtl_ocaml_progress(struct xentoollog_l= ogger *logger, CAMLparam0(); CAMLlocalN(args, 5); struct caml_xtl *xtl =3D (struct caml_xtl*)logger; - value *func =3D caml_named_value(xtl->progress_cb) ; + const value *func =3D caml_named_value(xtl->progress_cb) ; =20 if (func =3D=3D 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/xen= light_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 =3D NULL; + static const value *exc =3D NULL; =20 /* First time around, lookup by name */ if (!exc) @@ -424,7 +424,7 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_c= allback) caml_leave_blocking_section(); CAMLparam0(); CAMLlocal2(error, tmp); - static value *func =3D NULL; + static const value *func =3D NULL; value *p =3D (value *) for_callback; =20 if (func =3D=3D NULL) { @@ -1133,7 +1133,7 @@ value stub_libxl_xen_console_read_start(value ctx, va= lue clear) =20 static void raise_eof(void) { - static value *exc =3D NULL; + static const value *exc =3D NULL; =20 /* First time around, lookup by name */ if (!exc) @@ -1274,7 +1274,7 @@ int fd_register(void *user, int fd, void **for_app_re= gistration_out, CAMLparam0(); CAMLlocalN(args, 4); int ret =3D 0; - static value *func =3D NULL; + static const value *func =3D NULL; value *p =3D (value *) user; value *for_app; =20 @@ -1317,7 +1317,7 @@ int fd_modify(void *user, int fd, void **for_app_regi= stration_update, CAMLparam0(); CAMLlocalN(args, 4); int ret =3D 0; - static value *func =3D NULL; + static const value *func =3D NULL; value *p =3D (value *) user; value *for_app =3D *for_app_registration_update; =20 @@ -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 =3D NULL; + static const value *func =3D NULL; value *p =3D (value *) user; value *for_app =3D for_app_registration; =20 @@ -1398,7 +1398,7 @@ int timeout_register(void *user, void **for_app_regis= tration_out, CAMLlocal2(sec, usec); CAMLlocalN(args, 4); int ret =3D 0; - static value *func =3D NULL; + static const value *func =3D NULL; value *p =3D (value *) user; struct timeout_handles *handles; =20 @@ -1450,7 +1450,7 @@ int timeout_modify(void *user, void **for_app_registr= ation_update, CAMLlocal1(for_app_update); CAMLlocalN(args, 2); int ret =3D 0; - static value *func =3D NULL; + static const value *func =3D NULL; value *p =3D (value *) user; struct timeout_handles *handles =3D *for_app_registration_update; =20 @@ -1566,7 +1566,7 @@ void event_occurs(void *user, libxl_event *event) CAMLparam0(); CAMLlocalN(args, 2); struct user_with_ctx *c_user =3D (struct user_with_ctx *) user; - static value *func =3D NULL; + static const value *func =3D NULL; =20 if (func =3D=3D 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 =3D (struct user_with_ctx *) user; - static value *func =3D NULL; + static const value *func =3D NULL; =20 if (func =3D=3D NULL) { /* First time around, lookup by name */ --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel