Subject: Re: iconv(3) prototype
To: None <>
List: tech-userlevel
Date: 07/28/2004 15:54:38
From: (Christos Zoulas)
Subject: Re: iconv(3) prototype
Date: Tue, 27 Jul 2004 23:31:41 -0400
Message-ID: <>

> On Jul 27, 10:17pm, (Andrew Brown) wrote:
> -- Subject: Re: iconv(3) prototype
> | other than the periodic pain inflicted on the callee by const
> | (grr...strtol(3)), what kind of program would have trouble with our
> | iconv() but not the x/open one?
> You cannot write portable code that does not produce warnings.

Quite so.

The point of this problem is that the 2nd argument of iconv()
is "a pointer of a pointer".  "char *" can be converted to
"const char *" explicitly, but "char **" cannot be converted to
"const char **" without warning.

If the code is written so as not to get warnings with our iconv(),
it will get warnings with X/Open iconv().  v.v.

Really, here is the sole portable way: ((size_t (*)())iconv)(cd, &src, ....);
This is not the essence of this problem though.

So, I will change it, ok?