* [PATCH] Fix phony iconv build
@ 2016-10-17 14:16 Pedro Alves
2016-10-17 16:00 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2016-10-17 14:16 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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(+)
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;
--
2.5.5
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Fix phony iconv build
2016-10-17 14:16 [PATCH] Fix phony iconv build Pedro Alves
@ 2016-10-17 16:00 ` Tom Tromey
2016-10-17 16:04 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2016-10-17 16:00 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Tom Tromey
>>>>> "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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix phony iconv build
2016-10-17 16:00 ` Tom Tromey
@ 2016-10-17 16:04 ` Pedro Alves
0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2016-10-17 16:04 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-17 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17 14:16 [PATCH] Fix phony iconv build Pedro Alves
2016-10-17 16:00 ` Tom Tromey
2016-10-17 16:04 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox