[haiku-development] Re: Source-level incompatibility in iconv.h

  • From: "Jérôme Duval" <jerome.duval@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 27 Oct 2008 20:29:06 +0100

Hi Oliver,

2008/10/27 Oliver Tappe <zooey@xxxxxxxxxxxxxxx>:
> our iconv.h declares the iconv function with this signature:
>
>    size_t iconv(iconv_t, char**, size_t *, char**, size_t *);
>
> but I think it should rather make use of a const char** for the source
> buffer, like this:
>
>    size_t iconv(iconv_t, const char**, size_t *, char**, size_t *);

Though the Haiku definition is the one from POSIX:
http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html

>
> Using a non-const source buffer causes a problem when compiling libiconv on
> haiku, as that determines whether or not to use a const buffer by looking at
> the system's iconv.h header. As a result, the libiconv package on haiku-ports
> declares the source buffer as non-const.
> On R5, the iconv.h header didn't exist, which in turn caused the existing
> libiconv packages for R5 to declare the source buffer as const.
>
> With the current setup, any application that uses iconv() would have to
> explicitly cast away any potential constness of its internal buffers in order
> to be able to invoke haiku's iconv().

It's just the case on any OS, isn't it ?

Bye,
Jérôme

Other related posts: