tech-userlevel archive

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

Re: iconv(3) protype mismatch with POSIX



On Thu, Jun 16, 2016 at 12:27:47PM +0200, Kamil Rytarowski wrote:
 > >  > This is an interesting exercise to use C11.. however:
 > >  > 1. Not all ports moved to gcc 4.9+,
 > >  > 2. pcc doesn't support it,
 > >  > 3. it won't work as a valid and acceptable C++ code.
 > >  > 4. Many software expects system headers to be C89, GNU89 etc, and
 > >  > doesn't request C11.
 > > 
 > > None of that matters, it just needs to be wrapped in suitable ifdefs.
 > 
 > All of them matters to me and C11 in a public-header is no-go.

Uh, I don't follow. What's wrong with

#if defined(_NETBSD_SOURCE_) && \
    defined(__GNUC_PREREQ__(5,3)) && !defined(__cplusplus)
(polymorphic iconv as suggested)
#else
(posix iconv)
#endif

?

 > > "extern" option?
 > 
 > NAME
 > 
 > iconv - code conversion function
 > 
 > SYNOPSIS
 > 
 >    Default
 > 
 > #include <iconv.h>
 > 
 > extern size_t iconv(iconv_t cd, const char **restrict inbuf,
 > size_t *restrict inbytesleft, char **restrict outbuf,
 > size_t *restrict outbytesleft);
 > 
 > 
 > SUSv3
 > #include <iconv.h>
 > 
 > size_t iconv(iconv_t cd, char **restrict inbuf,
 > size_t *restrict inbytesleft, char **restrict outbuf,
 > size_t *restrict outbytesleft);

Uh, I have no idea what you're getting at.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index