|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] bogus wrap check in xen-netback
>>> On 25.04.18 at 11:04, <olaf@xxxxxxxxx> wrote:
> Am Wed, 25 Apr 2018 09:59:23 +0100
> schrieb Wei Liu <wei.liu2@xxxxxxxxxx>:
>
>> Do you have the full diff of your changes?
>
> Not right now. But without 'val', or val being uint, the same error happens
> in f():
>
> #include <stdio.h>
> void f(void)
> {
> unsigned short req_prod = 0, req_cons = 65400;
> unsigned short val;
> val = req_prod - req_cons;
> printf("req_prod - req_cons %u\n", val);
> printf("req_prod - req_cons %x\n", val);
> }
Well, of course - anything more narrow than int will be promoted to int first.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |