scott.wl.furry at gmail.com
Wed Mar 11 00:27:48 UTC 2015
On 10/03/2015 18:05, Ben Woods wrote:
> On Wednesday, March 11, 2015, Scott Furry <scott.wl.furry at gmail.com
> <mailto:scott.wl.furry at gmail.com>> wrote:
> I am running into in a situation with other C code where a call to
> iconv and passing in a non-const source buffer would result in a
> build warning. Others who use the same code on other platforms do
> not report this warning.
> In tracking down the issue, I have discovered that there may be a
> difference in the iconv.h header file used on FreeBSD versus
> Mac/Linux et al.
> line 48 shows that call to iconv
> size_t iconv (iconv_t /*cd*/,
> char ** __restrict /*inbuf*/, size_t * __restrict
> char ** __restrict /*outbuf*/, size_t * __restrict
> /usr/local/include/iconv.h, line 83, shows something rather different.
> Even the commentary around the code is different.
> extern size_t iconv (iconv_t cd, const char* * inbuf, size_t
> *inbytesleft, char* * outbuf, size_t *outbytesleft);
> My question is this, are we using a different or FreeBSD-specific
> version of iconv?
> FreeBSD has its own native iconv (since FreeBSD 10).
> More details (including reference to commits) here:
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.
More information about the freebsd-ports