git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFH] NetBSD 6?

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 8, 2013, 19:03 UTC
Message-ID
<7vy5g3cx9v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<rmiobgz4icr.fsf@fnord.ir.bbn.com>
Greg Troxel <gdt@ir.bbn.com> writes:
Show 34 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>>>  [OLD_ICONV]
>
>> It refers to the type of the second parameter to iconv(); OLD_ICONV
>> makes it take "const char *", as opposed to "char *", the latter of
>> which matches
>>
>>   http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
>
> I just wanted to follow up on this.  It turns out that the old POSIX
> standard was buggy (header file and function spec were different), and
> they resolved it in favor of non-const.  NetBSD followed the const way,
> and just now documented that with links to the standards email archives.
>
> Interestingly, GNU iconv 1.14 seems to define it as const also:
>
>   https://www.gnu.org/savannah-checkouts/gnu/libiconv/documentation/libiconv-1.14/iconv.3.html
>
> (which matches man/iconv.3 in the tarball).
>
> When I build libiconv-1.14, it produces a .h with const.  But it has a
> configure test to check if there is a host include file with const, and
> puts the const in the built header file or not to match!
> In include/iconv.h.in, there is:
>
>   extern size_t iconv (iconv_t cd,
>       @ICONV_CONST@ char* * inbuf, size_t *inbytesleft,
>        char* * outbuf, size_t *outbytesleft);
>
> Someday, it would be nice to have the configure test not fail an iconv
> implementation just because of the const, unless the presence of const
> is causing a real problem.  But I can understand that no one thinks
> that's important enough to get around to.
Interesting.

Don't get too offended by the "OLD_" prefix to that symbol, by the way. I do not think "old" means "old and broken hence fixed in newer version and you are low life if you live on a platform that has to define it" ;-).

We just needed to have a boolean to tell which variant it is to let the compiler build objects without complaining, and we named that switch as OLD_ICONV.

Previous: Greg TroxelNext: Greg Troxel
Message 10 of 11 in “[RFH] NetBSD 6?”
  1. Junio C HamanoJan 2, 2013
  2. Greg TroxelJan 3, 2013
  3. Greg TroxelJan 3, 2013
  4. Junio C HamanoJan 3, 2013
  5. Greg TroxelJan 3, 2013
  6. Junio C HamanoJan 3, 2013
  7. Greg TroxelJan 3, 2013
  8. Stefano LattariniJan 3, 2013
  9. Greg TroxelJan 8, 2013
  10. Junio C HamanoJan 8, 2013
  11. Greg TroxelJan 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.