On 23/07/18 10:30, Wei Liu wrote:
> Clang complains:
>
> systemd_stubs.c:51:8: error: shifting a negative signed value is undefined 
> [-Werror,-Wshift-negative-value]
>         ret = Val_int(-1U);
>               ^~~~~~~~~~~~
>
> Simply change the return value to 0.

That will break the function though, as it previously returned -1.

Unfortunately, the breakage here is inside Val_int(), which is defined
thusly:

typedef long intnat;

#define Val_long(x)     (((intnat)(x) << 1) + 1)
#define Long_val(x)     ((x) >> 1)
#define Val_int(x) Val_long(x)
#define Int_val(x) ((int) Long_val(x))

I can't see any way of making Val_int() work for negative integers.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to