Re: iconv: more pain


Subject: Re: iconv: more pain
From: David Mandelin (mandelin@cs.wisc.edu)
Date: Mon Aug 20 2001 - 14:48:04 CDT


Dom Lachowicz wrote:
>
> Quoting David Mandelin <mandelin@cs.wisc.edu>:
>
> > Dom Lachowicz wrote:
> > >
> > > 1) I've made my proposed change to UT_iconv which should handle the
> > const_cast
> > > properly on all compilers and iconv implementations. Should be fixed
> > now, but if
> > > this breaks for anyone, please tell me
> >
> > It breaks MSVC 6 and gcc2.95.3-5. On MSVC, "ut_iconv.cpp(143) : error
> > C2664: 'iconv' : cannot convert parameter 2 from 'char ** ' to 'const
> > char ** ' Conversion loses qualifiers". On gcc, "initialization to
> > `const char **' from `char **' adds cv-quals without intervening
> > `const'".
>
> Ok, this might or might not be fixed for everyone now. I also committed fixes
> for some high 1800 bugs whose numbers escape me now. Please cvs update and let
> me know how things go.

Nope. The new version still requires implicitly converting 'char **' to
'const char **'. I don't think anything like this is going to work. (To
work on conforming-compiler/iconv-without-const, you need to cast away
the const. If you put ICONV_CONST in the cast, gcc3 is unhappy. If you
don't, on a conforming compiler, you'll need to cast the const back in.
But then that won't work if you have gcc3/iconv-without-const.)

ICONV_CONST char ** buf = const_cast<char **>(inbuf);



This archive was generated by hypermail 2b25 : Mon Aug 20 2001 - 14:48:40 CDT