Re: [Qemu-devel] [PATCH v4 1/5] Use qemu_strtoul instead of strtol

2016-01-09 Thread Cao jin
On 01/09/2016 01:35 AM, Eric Blake wrote: On 01/08/2016 01:37 AM, Cao jin wrote: strtol() don`t guarantee errno to be ERANGE on overflow. I stand slightly corrected: C99 requires ERANGE on overflow, but not EINVAL; it is POSIX that adds EINVAL, but does not properly require it. At any rate

Re: [Qemu-devel] [PATCH v4 1/5] Use qemu_strtoul instead of strtol

2016-01-08 Thread Eric Blake
On 01/08/2016 01:37 AM, Cao jin wrote: > strtol() don`t guarantee errno to be ERANGE on overflow. I stand slightly corrected: C99 requires ERANGE on overflow, but not EINVAL; it is POSIX that adds EINVAL, but does not properly require it. At any rate, my main point was that errno is not always pr