iconv prototype (was: Re: lftp-pre3.0.0-20040115)

2004-01-16 Thread Alexander V. Lukyanov
It seems that char** is correct, according to Ulrich Drepper: http://sources.redhat.com/ml/bug-glibc/2000-10/msg6.html I was under impression of the reverse, sorry about that. There was also some iconv discussion on abiword mailing list back in 2001:

Re: lftp-pre3.0.0-20040115

2004-01-15 Thread Glenn Maynard
On Thu, Jan 15, 2004 at 09:51:22AM +0300, Alexander V. Lukyanov wrote: What's new: Had some trouble building from CVS: automake outputs: Makefile.am:3: AM_GNU_GETTEXT in `configure.ac' but `intl' not in SUBDIRS src/Makefile.am:42: variable `SOCKSLIBS' not defined The second is just an

Re: lftp-pre3.0.0-20040115

2004-01-15 Thread Alexander V. Lukyanov
On Thu, Jan 15, 2004 at 03:23:52AM -0500, Glenn Maynard wrote: On Thu, Jan 15, 2004 at 09:51:22AM +0300, Alexander V. Lukyanov wrote: What's new: Had some trouble building from CVS: I have forgotten to commit some changes to CVS. Thanks for the fixes, I have applied them. The iconv case is

Re: lftp-pre3.0.0-20040115

2004-01-15 Thread Alexander V. Lukyanov
On Thu, Jan 15, 2004 at 07:14:10AM -0500, Glenn Maynard wrote: On Thu, Jan 15, 2004 at 02:19:41PM +0300, Alexander V. Lukyanov wrote: The iconv case is the nastiest, since iconv should actually take const char** as source string. I don't think so. Try this: #include string.h void

Re: lftp-pre3.0.0-20040115

2004-01-15 Thread Alexander V. Lukyanov
On Thu, Jan 15, 2004 at 04:51:48PM +0300, Alexander V. Lukyanov wrote: I understand the reason. An autoconf test should be written to determine the iconv prototype and depending on that test a const cast should be used. I have found that AM_ICONV macro from gettext does the job and defines

Re: lftp-pre3.0.0-20040115

2004-01-15 Thread Glenn Maynard
On Thu, Jan 15, 2004 at 04:51:48PM +0300, Alexander V. Lukyanov wrote: #include string.h void func( const char **p ) { } main() { char *str = strdup(abc); func( str ); } test.cc:6: error: invalid conversion from `char**' to `const char**' It's actually the reverse.

Re: lftp-pre3.0.0-20040115

2004-01-15 Thread Glenn Maynard
On Thu, Jan 15, 2004 at 06:29:59PM +0300, Alexander V. Lukyanov wrote: I have found that AM_ICONV macro from gettext does the job and defines ICONV_CONST to const if the const is needed. So the cast become (ICONV_CONST char**)put_buf The safest way to do this is to use const_castconst char