tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: iconv(3) prototype



In article <20080127202930.GA16259%silence.homedns.org@localhost>,
Klaus Heinz  <k.heinz%janacht.kh-22.de@localhost> wrote:
>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?

I think we should just keep it. Most autoconf'ed programs deal with this
properly. and it seems that there is a trend to go back to const now:

http://www.gnu.org/software/libiconv/documentation/libiconv/iconv.3.html

christos




Home | Main Index | Thread Index | Old Index