[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 http://sourceware.org/bugzilla/show_bug.cgi?id=2962
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
problem.
J'
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;
outbytes--;
- text++;
+ inbuf++;
inbytes--;
break;
}
--
"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
recognition
this evening." --Scrymarch
_______________________________________________
pspp-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/pspp-dev
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature