[PATCH 5/6] Make error_t an enumeration on all supported OSes.
Florian Weimer
fweimer@redhat.com
Wed Jun 14 13:10:00 GMT 2017
Zack Weinberg <zackw@panix.com> writes:
> We could conceivably change __errno_location to return an error_t,
> which would mean 'p errno' in GDB would print symbolic values without
> needing to cast it, but I hesitate to make the apparent type of errno
> not be 'int'.
That sounds a bit hackish because I'm not sure int * and error_t * are
types with that level of compatibility.
You would get a long list of warnings from code like this:
switch (errno)
{
case ENOSYS:
...
break;
case EINVAL:
...
break;
}
We might also run into problems if the kernel ever adds error constants
with values which change the representation of error_t.
Florian
More information about the Libc-alpha
mailing list