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: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: yao at codesourcery dot com, gdb-patches at sourceware dot org, gregory dot 0xf0 at gmail dot com, brobecker at adacore dot com
- Date: Fri, 14 Nov 2014 16:31:40 +0200
- 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>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 14 Nov 2014 13:21:01 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org, gregory.0xf0@gmail.com, Joel Brobecker <brobecker@adacore.com>
>
> > @@ -651,6 +652,7 @@ wchar_iterate (struct wchar_iterator *iter,
> > switch (errno)
> > {
> > case EILSEQ:
> > + case ENOENT:
> > /* Invalid input sequence. We still might have
> > converted a character; if so, return it. */
> > if (out_avail < out_request * sizeof (gdb_wchar_t))
> >
> > This looks cleaner to me (some comments should be added, of course).
>
> 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...
The last one is easy:
case EILSEQ:
+#if EILSEQ != ENOENT
+ case ENOENT:
+#endif