On 2015/11/10 17:56, Stefan Hajnoczi wrote:

> The C99 standard says:
> 
> 6.3.1.1 Boolean, characters, and integers
> 
> - The rank of a signed integer type shall be greater than the rank of
> any signed integer type with less precision.
> 
> ...
> 
> - The rank of any unsigned integer type shall equal the rank of the
> corresponding signed integer type, if any.
> 
> 6.3.1.8 Usual arithmetic conversions
> 
> Otherwise, if the operand that has unsigned integer type has rank
> greater or equal to the rank of the type of the other operand, then the
> operand with signed integer type is converted to the type of the operand
> with unsigned integer type.
> 
> So the max_xfer_len int operand must be converted to the higher ranking
> unsigned long long.
> 

Thank you so much, it's clear. I'll add a check before subtraction.
Please review v4.

Regards,
-Gonglei



Reply via email to