This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 5/6] Make error_t an enumeration on all supported OSes.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: libc-alpha at sourceware dot org, joseph at codesourcery dot com
- Date: Wed, 14 Jun 2017 15:10:49 +0200
- Subject: Re: [PATCH 5/6] Make error_t an enumeration on all supported OSes.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3C56A80F97
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3C56A80F97
- References: <20170610171738.22362-1-zackw@panix.com> <20170610171738.22362-6-zackw@panix.com>
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