[Cbe-oss-dev] [PATCH] make arguments 64 big unconditionally
Joel Schopp
jschopp at austin.ibm.com
Mon Aug 13 15:46:56 EST 2007
>> + errno = ENOMEM;
>
> I think setting errno is wrong here and the other places. calloc and
> malloc and realloc are not documented to change errno in C99, just
> NULL or a valid memory location.
>
I guess it depends on which standard you read:
http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html
As near as I can tell some standards don't mention errno one way or the other, and
thus it doesn't violate the standards to use it. Meanwhile other standards require
errno to be set to certain values in certain conditions. Thus in order to follow all
standards requires setting errno.
More information about the cbe-oss-dev
mailing list