[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fix i18n.c warning

From: John Darrington
Subject: Re: fix i18n.c warning
Date: Sat, 24 Feb 2007 17:28:34 +0900
User-agent: Mutt/1.5.9i

On Thu, Feb 22, 2007 at 03:52:59PM -0800, Ben Pfaff wrote:
     The following patch fixes a warning about an incompatible pointer
     type.  OK to check it in?

The problem is that libc defines iconv to take char ** whereas
libiconv defines it to take const char **.  So whatever we do, there's
going to be an warning on one platform or the other.

The libc developers refuse to fix it, because it follows the mistake
made by POSIX

I suppose we'll have to do an autoconf macro to determine the
signature of iconv and make a replacement wrapper to get around this


In my opinion this decision is silly.  I suppose 
     Index: src/libpspp/i18n.c
     RCS file: /cvsroot/pspp/pspp/src/libpspp/i18n.c,v
     retrieving revision 1.5
     diff -u -p -r1.5 i18n.c
     --- src/libpspp/i18n.c     21 Feb 2007 08:27:16 -0000      1.5
     +++ src/libpspp/i18n.c     22 Feb 2007 23:25:10 -0000
     @@ -64,6 +64,7 @@ create_iconv (const char* tocode, const 
      char *
      recode_string(enum conv_id how,  const char *text, int length)
     +  char *inbuf;
        char *outbuf = 0;
        size_t outbufferlength;
        size_t result;
     @@ -94,9 +95,10 @@ recode_string(enum conv_id how,  const c
        outbytes = outbufferlength;
        inbytes = length;
     +  inbuf = text;
        do {
     -    result = iconv(convertor[how], &text, &inbytes, 
     +    result = iconv(convertor[how], &inbuf, &inbytes, 
                   &op, &outbytes);
          if ( -1 == result ) 
     @@ -111,7 +113,7 @@ recode_string(enum conv_id how,  const c
                *op++ = fallbackchar;
     -          text++;
     +          inbuf++;
     "Platonically Evil Monkey has been symbolically representing the darkest 
      fears of humanity since the dawn of literature and religion, and I think
      I speak for everyone when I give it a sidelong glance of uneasy 
      this evening." --Scrymarch
     pspp-dev mailing list

PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]