]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
tools/vchan: Fix -Wsingle-bit-bitfield-constant-conversion
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Aug 2023 13:53:42 +0000 (14:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 22 Aug 2023 13:36:53 +0000 (14:36 +0100)
Gitlab reports:

  node.c:158:17: 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->blocking = 1;
                       ^ ~
  1 error generated.
  make[4]: *** [/builds/xen-project/people/andyhhp/xen/tools/vchan/../../tools/Rules.mk:188: node.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 <andrew.cooper3@citrix.com>
tools/vchan/node.c

index f1638f013d3d5fc4f00427080848f8022ae7efed..a28293b720703b7080afe18a146f42222417964d 100644 (file)
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
                perror("libxenvchan_*_init");
                exit(1);
        }
-       ctrl->blocking = 1;
+       ctrl->blocking = -1;
 
        srand(seed);
        fprintf(stderr, "seed=%d\n", seed);