Subject: Re: iconv(3) prototype
From: Andrew Brown <>
List: tech-userlevel
Date: 07/28/2004 09:41:16
On Wed, Jul 28, 2004 at 03:54:38PM +0900, T.SHIOZAKI wrote:
>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.

ah, i see.  i was reading the "const char **restrict" as if it were
"char *const*restrict".  now i remember why i don't like thinking
about this stuff.  bleah.

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

yes, i see.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."