Subject: Re: iconv(3) prototype
To: T.SHIOZAKI <tshiozak@NetBSD.org>
From: Andrew Brown <atatat@atatdot.net>
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.com (Christos Zoulas)
>Subject: Re: iconv(3) prototype
>Date: Tue, 27 Jul 2004 23:31:41 -0400
>Message-ID: <20040728033141.0108C2AC78@beowulf.gw.com>
>
>> On Jul 27, 10:17pm, atatat@atatdot.net (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" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."