Message ID | 1476713788-18547-1-git-send-email-palves@redhat.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 25126 invoked by alias); 17 Oct 2016 14:16:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25113 invoked by uid 89); 17 Oct 2016 14:16:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Oct 2016 14:16:31 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87218C05678E; Mon, 17 Oct 2016 14:16:30 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9HEGTXF025185; Mon, 17 Oct 2016 10:16:29 -0400 From: Pedro Alves <palves@redhat.com> To: gdb-patches@sourceware.org Cc: Tom Tromey <tom@tromey.com> Subject: [PATCH] Fix phony iconv build Date: Mon, 17 Oct 2016 15:16:28 +0100 Message-Id: <1476713788-18547-1-git-send-email-palves@redhat.com> |
Commit Message
Pedro Alves
Oct. 17, 2016, 2:16 p.m. UTC
Cross building for mingw32, I see: x86_64-w64-mingw32-g++ -g -O2 [...] ../../src/gdb/charset.c In file included from ../../src/gdb/charset.c:21:0: ../../src/gdb/charset.h:134:3: error: 'iconv_t' does not name a type iconv_t m_desc; ^ ../../src/gdb/charset.c: In constructor 'wchar_iterator::wchar_iterator(const gdb_byte*, size_t, const char*, size_t)': ../../src/gdb/charset.c:600:3: error: 'm_desc' was not declared in this scope m_desc = iconv_open (INTERMEDIATE_ENCODING, charset); ^ ../../src/gdb/charset.c: In destructor 'wchar_iterator::~wchar_iterator()': ../../src/gdb/charset.c:607:7: error: 'm_desc' was not declared in this scope if (m_desc != (iconv_t) -1) ^ ../../src/gdb/charset.c: In member function 'int wchar_iterator::iterate(wchar_iterate_result*, gdb_wchar_t**, const gdb_byte**, size_t*)': ../../src/gdb/charset.c:633:25: error: 'm_desc' was not declared in this scope size_t r = iconv (m_desc, &inptr, &m_bytes, &outptr, &out_avail); ^ This is a regression caused by commit cda6c55bd399 (Turn wchar iterator into a class). The problem is that iconv_t is now exposed in charset.h, while before it was only used in charset.c. gdb/charset.c, under #ifdef PHONY_ICONV, does: #undef iconv_t #define iconv_t int So it seems the simplest is to use 'int' in the header file too. Tromey, WDYT? gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * charset.h (class wchar_iterator) [PHONY_ICONV] <m_desc>: Use 'int' as type. --- gdb/charset.h | 4 ++++ 1 file changed, 4 insertions(+)
Comments
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> This is a regression caused by commit cda6c55bd399 (Turn wchar
Pedro> iterator into a class). The problem is that iconv_t is now exposed in
Pedro> charset.h, while before it was only used in charset.c. gdb/charset.c,
Pedro> under #ifdef PHONY_ICONV, does:
I'm sorry about that.
Pedro> So it seems the simplest is to use 'int' in the header file too.
Pedro> Tromey, WDYT?
Looks good, thanks.
Tom
On 10/17/2016 04:59 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes: > > Pedro> This is a regression caused by commit cda6c55bd399 (Turn wchar > Pedro> iterator into a class). The problem is that iconv_t is now exposed in > Pedro> charset.h, while before it was only used in charset.c. gdb/charset.c, > Pedro> under #ifdef PHONY_ICONV, does: > > I'm sorry about that. No worries. Seems like no build slave is exercising this code path. > Pedro> So it seems the simplest is to use 'int' in the header file too. > Pedro> Tromey, WDYT? > > Looks good, thanks. Thanks, I'll push it in soon. Thanks, Pedro Alves
diff --git a/gdb/charset.h b/gdb/charset.h index 64aa58d..c5feb08 100644 --- a/gdb/charset.h +++ b/gdb/charset.h @@ -131,7 +131,11 @@ class wchar_iterator private: /* The underlying iconv descriptor. */ +#ifdef PHONY_ICONV + int m_desc; +#else iconv_t m_desc; +#endif /* The input string. This is updated as we convert characters. */ const gdb_byte *m_input;