This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gnulib's errno module was imported
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>, <gregory dot 0xf0 at gmail dot com>, Joel Brobecker <brobecker at adacore dot com>
- Date: Fri, 14 Nov 2014 21:53:51 +0800
- Subject: Re: gnulib's errno module was imported
- Authentication-results: sourceware.org; auth=none
- References: <87oasaibe6 dot fsf at codesourcery dot com> <5465EBAD dot 3070108 at redhat dot com> <87fvdmhr5o dot fsf at codesourcery dot com> <546601BD dot 7020700 at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> That was actually my first approach, but then:
>
> - I thought that having a central place to handle this
> and to put the comment was cleaner than repeating the fix
> in multiple places.
> - That won't build on systems that EILSEQ and ENOENT are
> defined to the same value (two switch cases with the same value).
> Not sure there are any such systems, but given iconv.h's practice...
>
> I guess I could also simplify and remove the GNULIB_defined_EILSEQ
> guard, mapping ENOENT to EILSEQ everywhere ?
I don't have a strong feeling on this, so either is OK to me.
>
> +/* On systems that don't have EILSEQ, GNU iconv's iconv.h defines it
> + to ENOENT. gnulib instead defines it to a different value. On
> + such systems, map ENOENT to gnulib's EILSEQ, leaving callers
> + agnostic. */
> +#ifdef GNULIB_defined_EILSEQ
>
> I looked at glibc's iconv and it seems that ENOENT is never used
> there, so should be safe.
Good, could you please commit your patch?
--
Yao (éå)