Subject: Re: iconv(3) prototype
To: None <tech-userlevel@NetBSD.org>
From: Klaus Heinz <k.heinz@janacht.kh-22.de>
List: tech-userlevel
Date: 01/27/2008 21:29:30
Hi,

after seeing this for a long time I finally took a look at the source of
this warning:

  warning: passing arg 2 of `iconv' from incompatible pointer type

The problem derives from the fact that NetBSD provides this iconv()
prototype

  size_t
  iconv(iconv_t cd, const char ** restrict src, size_t * restrict srcleft,
         char ** restrict dst, size_t * restrict dstleft);

(according to http://opengroup.org/onlinepubs/007908799/xsh/iconv.html)

and many (most?) programs expect this prototype

   size_t iconv(iconv_t cd, char **restrict inbuf,
          size_t *restrict inbytesleft, char **restrict outbuf,
          size_t *restrict outbytesleft);

(see http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html)

This was already discussed here

  http://mail-index.netbsd.org/tech-userlevel/2004/07/26/0001.html

There seemed to be a trend to change the prototype to the current
standard but then the already implemented change was reverted and a
final decision deferred until there would be input by Klaus Klein.
It looks like this never happened.

Should we change this or still keep our existing prototype?

ciao
     Klaus