From: Andrew Cooper Date: Tue, 8 Aug 2023 13:53:42 +0000 (+0100) Subject: libs/vchan: Fix -Wsingle-bit-bitfield-constant-conversion X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=38306739f6c48d76a33c510cdabee78ec1f1138d;p=people%2Ftklengyel%2Fxen.git libs/vchan: Fix -Wsingle-bit-bitfield-constant-conversion Gitlab reports: init.c:348:18: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] ctrl->is_server = 1; ^ ~ 1 error generated. make[6]: *** [/builds/xen-project/people/andyhhp/xen/tools/libs/vchan/../../../tools/Rules.mk:188: init.o] Error 1 In Xen 4.18, this was fixed with c/s 99ab02f63ea8 ("tools: convert bitfields to unsigned type") but this is an ABI change which can't be backported. Swich 1 for -1 to provide a minimally invasive way to fix the build. No functional change. Signed-off-by: Andrew Cooper --- diff --git a/tools/libs/vchan/init.c b/tools/libs/vchan/init.c index 9195bd3b98..b3de8f96fe 100644 --- a/tools/libs/vchan/init.c +++ b/tools/libs/vchan/init.c @@ -345,7 +345,7 @@ struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger, ctrl->ring = NULL; ctrl->event = NULL; - ctrl->is_server = 1; + ctrl->is_server = -1; ctrl->server_persist = 0; ctrl->read.order = min_order(left_min);