Re: Cast abuse



On 2001.11.20 05:38 Pawel Salek wrote:
...
> 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

That's the version I have, and gcc complains about passing from an 
incompatible pointer type if when inbuf is passed from a const char **.

The __restrict stuff is a mystery to me, but it doesn't look as though 
it can be defined so as to change the declaration to a const char **. 
So until the header file gets updated, I believe we need the cast.

Peter



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