Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 2015 15:03:05 -0600
From:      Scott Furry <scott.wl.furry@gmail.com>
To:        Christian Weisgerber <naddy@mips.inka.de>, freebsd-ports@freebsd.org
Subject:   Re: converters/iconv versioning
Message-ID:  <5504A209.3030608@gmail.com>
In-Reply-To: <slrnmg91pj.2n6s.naddy@lorvorc.mips.inka.de>
References:  <54FF75A2.4020803@gmail.com> <CAOc73CAGxtx%2B2P-c4aX3E_PidZ7ThW85zni1_cvgutqhzfYQrw@mail.gmail.com> <54FF8A19.3090700@gmail.com> <slrnmg91pj.2n6s.naddy@lorvorc.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14/03/2015 13:08, Christian Weisgerber wrote:
> On 2015-03-11, Scott Furry <scott.wl.furry@gmail.com> wrote:
>> Okay...different iconv. But what's the reason for change?
>> And does this one function call really need to be const? Is the
>> __restrict in the type not used on FreeBSD?
>>
>> Seems strange to differ on a gnu-based.
> POSIX says:
>
> size_t iconv(iconv_t cd, char **restrict inbuf,
>         size_t *restrict inbytesleft, char **restrict outbuf,
>         size_t *restrict outbytesleft);
>
> For GNU iconv, whether you have a const in the prototype or not is
> configurable.  I think by default it tries to match the prototype
> of an existing iconv on the machine.  The FreeBSD port specifically
> asks for the const, presumably for consistency with earlier versions.
Christian,
Ran into a situation with other code where clang would issue a warning 
about calling iconv function without const variable.
That's when I discovered the difference with FreeBSD's iconv (sorry, 
haven't memorized the handbook or porters handbook ;-) ).
The function declaration you show matches what I've seen on both Mac and 
Linux. So iconv being used on FreeBSD differs from posix?

Custom iconv Just seemed odd. Had to ask.
Thanks for filling in a blank.
Scott



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5504A209.3030608>