From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8915 invoked by alias); 23 Mar 2009 17:15:39 -0000 Received: (qmail 8907 invoked by uid 22791); 23 Mar 2009 17:15:37 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Mar 2009 17:15:30 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n2NHFAPQ045282 ; Mon, 23 Mar 2009 18:15:10 +0100 (CET) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n2NHFAMM039437 ; Mon, 23 Mar 2009 18:15:10 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n2NHFAOB008922 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Mon, 23 Mar 2009 18:15:10 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Tom Tromey'" Cc: References: <000f01c9abcd$6b0e8990$412b9cb0$@u-strasbg.fr> In-Reply-To: Subject: RE: [Build failure] chartset.c build failure: iconv 2nd argument type problem Date: Mon, 23 Mar 2009 17:27:00 -0000 Message-ID: <001901c9abda$f0f0e870$d2d2b950$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00495.txt.bz2 Yes, it fixes the compilation failure for me, thanks for the fact reaction. Pierre Muller Pascal language support maintainer for GDB > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Tom Tromey > Envoy=E9=A0: Monday, March 23, 2009 5:04 PM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [Build failure] chartset.c build failure: iconv 2nd > argument type problem >=20 > >>>>> "Pierre" =3D=3D Pierre Muller writes: >=20 > Pierre> On cygwin, the current iconv function has a (const char **) > Pierre> type for the second argument, whereas other implementations > Pierre> seem to be using (char **) type. >=20 > Oops, I'm sorry about breaking the build for you. >=20 > Pierre> Tom, could you please take a look at this? >=20 > Please try the appended patch. If this works for you, I will check it > in. >=20 > Tom >=20 > diff --git a/gdb/charset.c b/gdb/charset.c > index 5efb849..3c56613 100644 > --- a/gdb/charset.c > +++ b/gdb/charset.c > @@ -86,6 +86,9 @@ > #undef iconv > #undef iconv_close >=20 > +#undef ICONV_CONST > +#define ICONV_CONST const > + > iconv_t > iconv_open (const char *to, const char *from) > { > @@ -109,7 +112,7 @@ iconv_close (iconv_t arg) > } >=20 > size_t > -iconv (iconv_t ucs_flag, char **inbuf, size_t *inbytesleft, > +iconv (iconv_t ucs_flag, const char **inbuf, size_t *inbytesleft, > char **outbuf, size_t *outbytesleft) > { > if (ucs_flag) > @@ -440,7 +443,7 @@ convert_between_encodings (const char *from, const > char *to, > outp =3D obstack_base (output) + old_size; > outleft =3D space_request; >=20 > - r =3D iconv (desc, &inp, &inleft, &outp, &outleft); > + r =3D iconv (desc, (ICONV_CONST char **) &inp, &inleft, &outp, > &outleft); >=20 > /* Now make sure that the object on the obstack only includes > bytes we have converted. */ > @@ -580,7 +583,8 @@ wchar_iterate (struct wchar_iterator *iter, > size_t num; > gdb_wchar_t result; >=20 > - size_t r =3D iconv (iter->desc, (char **) &iter->input, &iter- > >bytes, > + size_t r =3D iconv (iter->desc, > + (ICONV_CONST char **) &iter->input, &iter->bytes, > &outptr, &out_avail); > if (r =3D=3D (size_t) -1) > {