This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA v2 06/17] Remove cleanup_iconv
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 12 Apr 2017 12:19:54 +0100
- Subject: Re: [RFA v2 06/17] Remove cleanup_iconv
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F0F7CC059747
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F0F7CC059747
- References: <20170411150112.23207-1-tom@tromey.com> <20170411150112.23207-7-tom@tromey.com>
On 04/11/2017 04:01 PM, Tom Tromey wrote:
> + iconv_wrapper (const char *from, const char *to)
> + {
> + m_desc = iconv_open (to, from);
...
> - desc = iconv_open (to, from);
> - if (desc == (iconv_t) -1)
> - perror_with_name (_("Converting character sets"));
> - cleanups = make_cleanup (cleanup_iconv, &desc);
> + iconv_wrapper desc (from, to);
>
I find the inversion of the order of "from" and "to" potentially
confusing/misleading, given this is a "wrapper" class. Is there a
rationale behind the swap?
Thanks,
Pedro Alves