[patch] Samba Janitorial work: non-const pointer in iconv.c

David Collier-Brown davecb at sun.com
Wed Jan 23 14:13:41 GMT 2008


  Oh bother, gcc complains when you add a const in a cast... which strikes
me as an interesting interpretation of the semantics of const and cast (;-))

  Is there a samba-standard way to deal with include/code declaration
conflicts?  The Slolaris compiler produces a similar diagnostic,
although lint seem to get it correctly...

--dave

Jeremy Allison wrote:
> On Tue, Jan 22, 2008 at 01:16:10PM -0500, David Collier-Brown wrote:
> 
>>In lib/iconv.c, we pass a non-const char ** pointer to iconv, and get
>>a warning from gcc.  The correction is:
> 
> 
> Unfortunately the Linux header has :
> 
> extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
>                      size_t *__restrict __inbytesleft,
>                      char **__restrict __outbuf,
>                      size_t *__restrict __outbytesleft);
> 
> No const here.... :-(
> 

-- 
David Collier-Brown            | Always do right. This will gratify
Sun Microsystems, Toronto      | some people and astonish the rest
davecb at sun.com                 |                      -- Mark Twain
(800) 555-9786 x56583 cell: (647) 833-9377 home off: (416) 223-5943 


More information about the samba-technical mailing list