On Wed, Feb 07, 2001 at 11:58:42AM -0800, Mo DeJong wrote:
> On 7 Feb 2001, Jeff Trawick wrote:
> > > Here is the bit of code from the Jikes java compiler
> > > that deals with this issue.
> > > 
> > >                     size_t n = iconv(_converter,
> > > #ifdef HAVE_ERROR_CALL_ICONV_CONST
> > >                                      (char **)
> > > #endif
> > >                                      &source_ptr, &srcl,
> > >                                      (char **)&chp, &chl
> > >                     );
> > 
> > The code would be nicer if we define ICONV_INBUF_TYPE to "char **" or
> > "const char **" and then do
> 
> Well, that would just be casting a const char** to a const char **
> in the normal case, why put an extra cast in for no reason?
> I tend to like knowing about the exceptions and why they are in the
> code instead of having unexplained casts all over the place.
>  

Just for reference, in AbiWord this is dealt with in the following way

iconv(arg_1, (ICONV_CONST char **) arg_2, etc ...)

where ICONV_CONST is either defined to const or not depending on the
platform.  

I have to say that this is ugly and horrible, and really wish there
was a better solution. 
           
        sam th               
        [EMAIL PROTECTED]
        http://www.abisource.com/~sam/
        GnuPG Key:  
        http://www.abisource.com/~sam/key

Attachment: pgpsZpPLDDXMp.pgp
Description: PGP signature

Reply via email to