podivne chovani freebsd g++

Divacky Roman xdivac02 at stud.fit.vutbr.cz
Wed Sep 1 17:25:40 CEST 2004


On Tue, Aug 31, 2004 at 08:16:04PM +0200, Radim Kolar wrote:
> freebsd g++ 3.4 nebo 3.3 nechce provest auto-konverzi parametru na cost pri volani funkce, coz je naprosto normalni vec pouzivana snad v kazdem softu.
> 
> Normalni g++ 3.3 toto nedela. gcc 3.4 normalni jsem nezkousel.
> 
> (hsn at ttyv1):/tmp% g++ normalizemime.cc -I /usr/local/include              20:08
> normalizemime.cc: In function `std::string robust_iconv(void*, std::string&)':
> normalizemime.cc:504: error: invalid conversion from `char**' to `const char**'
> normalizemime.cc:504: error:   initializing argument 2 of `size_t libiconv(void*
> , const char**, size_t*, char**, size_t*)'
> (hsn at ttyv1):/tmp% gcc --version                                           20:08
> gcc (GCC) 3.4.2 [FreeBSD] 20040728
> 
> 495   char *icopy = new char [in_left];
> 496   assert (icopy);
> 497
> 498   char *obuf = buf;
> 499   memcpy (icopy, message.c_str(), in_left);
> 500   message.erase ();
> 501   char *ibuf = icopy;
> 502
> 503   while (in_left > 0) {
> 504     if ((size_t)(-1) == iconv (ic, &ibuf, &in_left, &obuf, &out_left)) {
> 
> cely kod programu je na http://hyvatti.iki.fi/~jaakko/spam/. Mam to poslat
> jako PR?

ja to vidim docela jednoznacne
    if ((size_t)(-1) == iconv (ic, &ibuf, &in_left, &obuf, &out_left)) {
zde je typecast na l-value coz je v gcc 3.4 zakazane... proc to hlasi jinou
hlasku uz je otazka na tvurce gcc

nebo se mylim?



More information about the Users-l mailing list