Re: Cast abuse



On 2001.11.20 11:17 Brian Stafford wrote:
>> where inbuf is often passed from a const char * variable.  There are a 
>> couple of files in libmutt that do this, and gcc gripes each time it 
>> sees them.  I imagine that's why the casts that Brian complained about 
>> in the ldap code were there.
> 
> I just checked glibc 2's iconv.h and the one distributed with GNU 
> libiconv.  Both declare inbuf to be const.  SUSv2 declares it const 
> too.  So I'd say the linux man page is incorrect.

glibc-devel-2.2.4-19:/usr/include/iconv.h contains:

extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
                      size_t *__restrict __inbytesleft,
                      char **__restrict __outbuf,
                      size_t *__restrict __outbytesleft);

I do not know what '__restrict' means (anybody knows?) but it does not 
appear to be equivalent to 'const'.

/Pawel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]