Hi, I'm trying to get an ebuild together to get dillo-2.0 into Gentoo Linux' portage repository. But compilation fails for me with: form.cc: In member function ?Dstr* DilloHtmlForm::encodeText(void*, Dstr**)?: form.cc:1261: error: invalid conversion from ?const char**? to ?char**? form.cc:1261: error: initializing argument 2 of ?size_t iconv(void*, char**, size_t*, char**, size_t*)? make[3]: *** [form.o] Error 1 This is with gcc-4.3.2. If anybody could have a look at this and shed some light on it (as I'm not a C++ coder myself), I would be grateful. Regards, -- Ben de Groot Gentoo Linux developer (lxde, media, desktop-misc) Gentoo Linux Release Engineering PR liaison __________________________________________________ yngwin@gentoo.org http://ben.liveforge.org/ irc://chat.freenode.net/#gentoo-media irc://irc.oftc.net/#lxde __________________________________________________
Ben wrote:
Hi,
I'm trying to get an ebuild together to get dillo-2.0 into Gentoo Linux' portage repository. But compilation fails for me with:
form.cc: In member function ?Dstr* DilloHtmlForm::encodeText(void*, Dstr**)?: form.cc:1261: error: invalid conversion from ?const char**? to ?char**? form.cc:1261: error: initializing argument 2 of ?size_t iconv(void*, char**, size_t*, char**, size_t*)? make[3]: *** [form.o] Error 1
This is with gcc-4.3.2. If anybody could have a look at this and shed some light on it (as I'm not a C++ coder myself), I would be grateful.
Did you run configure yourself? What type does inbuf_t have in config.log?
corvid wrote:
form.cc: In member function ?Dstr* DilloHtmlForm::encodeText(void*, Dstr**)?: form.cc:1261: error: invalid conversion from ?const char**? to ?char**? form.cc:1261: error: initializing argument 2 of ?size_t iconv(void*, char**, size_t*, char**, size_t*)?
Did you run configure yourself? What type does inbuf_t have in config.log?
yes, I ran configure first, with: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-gif --disable-ipv6 --enable-jpeg --enable-png --enable-ssl --build=i686-pc-linux-gnu % grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char -- Ben de Groot Gentoo Linux developer (lxde, media, desktop-misc) Gentoo Linux Release Engineering PR liaison __________________________________________________ yngwin@gentoo.org http://ben.liveforge.org/ irc://chat.freenode.net/#gentoo-media irc://irc.oftc.net/#lxde __________________________________________________
On Tue, 21 Oct 2008 19:39:51 +0200 Ben de Groot <yngwin@gentoo.org> wrote:
corvid wrote:
form.cc: In member function ?Dstr* DilloHtmlForm::encodeText(void*, Dstr**)?: form.cc:1261: error: invalid conversion from ?const char**? to ?char**? form.cc:1261: error: initializing argument 2 of ?size_t iconv(void*, char**, size_t*, char**, size_t*)?
Did you run configure yourself? What type does inbuf_t have in config.log?
yes, I ran configure first, with: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-gif --disable-ipv6 --enable-jpeg --enable-png --enable-ssl --build=i686-pc-linux-gnu
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
The iconv test is done with gcc in c-mode, form.cc in c++-mode. The first one might be less strict so the iconv test code in configure.in,configure does not produce errors. But -Wall should be added already to CFLAGS earlier.... Just some guesses. Greetings Andreas Kemnade
Ben wrote:
corvid wrote:
form.cc: In member function ?Dstr* DilloHtmlForm::encodeText(void*, Dstr**)?: form.cc:1261: error: invalid conversion from ?const char**? to ?char**? form.cc:1261: error: initializing argument 2 of ?size_t iconv(void*, char**, size_t*, char**, size_t*)?
Did you run configure yourself? What type does inbuf_t have in config.log?
yes, I ran configure first, with: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-gif --disable-ipv6 --enable-jpeg --enable-png --enable-ssl --build=i686-pc-linux-gnu
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
Hmm... A minute with google teaches me that gentoo people run into problems when system versions of things conflict with portage versions, but then I don't know enough to have any idea whether our config test would be picking up the wrong one for some reason...
On Tue, Oct 21, 2008 at 07:39:51PM +0200, Ben de Groot wrote:
corvid wrote:
form.cc: In member function ???Dstr* DilloHtmlForm::encodeText(void*, Dstr**)???: form.cc:1261: error: invalid conversion from ???const char**??? to ???char**??? form.cc:1261: error: initializing argument 2 of ???size_t iconv(void*, char**, size_t*, char**, size_t*)???
Did you run configure yourself? What type does inbuf_t have in config.log?
yes, I ran configure first, with: ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-gif --disable-ipv6 --enable-jpeg --enable-png --enable-ssl --build=i686-pc-linux-gnu
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
It looks like the test in configure.in detects iconv() in a strange way. What's inconv's signature in your OS? Just for testing try setting [char] instead of [const char] in configure.in:348. -- Cheers Jorge.-
Jorge Arellano Cid wrote:
On Tue, Oct 21, 2008 at 07:39:51PM +0200, Ben de Groot wrote:
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
It looks like the test in configure.in detects iconv() in a strange way.
Indeed, something seems to go wrong there. My glibc version is 2.8_p20080602.
What's inconv's signature in your OS?
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft);
Just for testing try setting [char] instead of [const char] in configure.in:348.
In our bugtracker another patch was proposed, which makes dillo compile for me. https://bugs.gentoo.org/show_bug.cgi?id=242774 --- src/form.cc 2008-10-21 21:02:31 +0000 +++ src/form.cc 2008-10-21 21:02:53 +0000 @@ -1240,8 +1240,9 @@ int rc = 0; Dstr *output; const int bufsize = 128; - inbuf_t *inPtr; - char *buffer, *outPtr; + //inbuf_t *inPtr; + //char *buffer, *outPtr; + char *buffer, *outPtr, *inPtr; size_t inLeft, outRoom; bool bad_chars = false; Does this patch look good to you? It looks like this issue doesn't pop up with glibc-2.6.1, which is our stable version. But obviously, I'd like it to work on our testing branch as well. Cheers, -- Ben de Groot Gentoo Linux developer (lxde, media, desktop-misc) Gentoo Linux Release Engineering PR liaison __________________________________________________ yngwin@gentoo.org http://ben.liveforge.org/ irc://chat.freenode.net/#gentoo-media irc://irc.oftc.net/#lxde __________________________________________________
On Wed, Oct 22, 2008 at 12:09:10AM +0200, Ben de Groot wrote:
Jorge Arellano Cid wrote:
On Tue, Oct 21, 2008 at 07:39:51PM +0200, Ben de Groot wrote:
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
It looks like the test in configure.in detects iconv() in a strange way.
Indeed, something seems to go wrong there. My glibc version is 2.8_p20080602.
What's inconv's signature in your OS?
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft);
OK. A "char **" not a "const char **".
Just for testing try setting [char] instead of [const char] in configure.in:348.
In our bugtracker another patch was proposed, which makes dillo compile for me. https://bugs.gentoo.org/show_bug.cgi?id=242774
--- src/form.cc 2008-10-21 21:02:31 +0000 +++ src/form.cc 2008-10-21 21:02:53 +0000 @@ -1240,8 +1240,9 @@ int rc = 0; Dstr *output; const int bufsize = 128; - inbuf_t *inPtr; - char *buffer, *outPtr; + //inbuf_t *inPtr; + //char *buffer, *outPtr; + char *buffer, *outPtr, *inPtr; size_t inLeft, outRoom; bool bad_chars = false;
Does this patch look good to you?
No. It seems to be enough for Gentoo, but I'd prefer to detect the type of inbuf_t correctly in configure.in, so it compiles out of the box. Please try the tweak-test in configure.in. If it works, we'll be sure proper detection will fix the bug. -- Cheers Jorge.-
On Wed, Oct 22, 2008 at 08:44:48AM -0300, Jorge Arellano Cid wrote:
On Wed, Oct 22, 2008 at 12:09:10AM +0200, Ben de Groot wrote:
Jorge Arellano Cid wrote:
On Tue, Oct 21, 2008 at 07:39:51PM +0200, Ben de Groot wrote:
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
It looks like the test in configure.in detects iconv() in a strange way.
Indeed, something seems to go wrong there. My glibc version is 2.8_p20080602.
What's inconv's signature in your OS?
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft);
OK.
A "char **" not a "const char **".
Just for testing try setting [char] instead of [const char] in configure.in:348.
In our bugtracker another patch was proposed, which makes dillo compile for me. https://bugs.gentoo.org/show_bug.cgi?id=242774
--- src/form.cc 2008-10-21 21:02:31 +0000 +++ src/form.cc 2008-10-21 21:02:53 +0000 @@ -1240,8 +1240,9 @@ int rc = 0; Dstr *output; const int bufsize = 128; - inbuf_t *inPtr; - char *buffer, *outPtr; + //inbuf_t *inPtr; + //char *buffer, *outPtr; + char *buffer, *outPtr, *inPtr; size_t inLeft, outRoom; bool bad_chars = false;
Does this patch look good to you?
No.
It seems to be enough for Gentoo, but I'd prefer to detect the type of inbuf_t correctly in configure.in, so it compiles out of the box.
One could think that using char* for inPtr would work for both cases (char ** and const char ** in the declaration of iconv), but it doesn't: void test(const char **s) {}; int main(int argc, char **argv) { char *s; test(&s); } fails with const.cc: In function 'int main(int, char**)': const.cc:5: error: invalid conversion from 'char**' to 'const char**' const.cc:5: error: initializing argument 1 of 'void test(const char**)' See e.g. http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.17 for the reason why this does not work. Cheers, Johannes
On Wed, Oct 22, 2008 at 12:09:10AM +0200, Ben de Groot wrote:
Jorge Arellano Cid wrote:
On Tue, Oct 21, 2008 at 07:39:51PM +0200, Ben de Groot wrote:
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
It looks like the test in configure.in detects iconv() in a strange way.
Indeed, something seems to go wrong there. My glibc version is 2.8_p20080602.
What's inconv's signature in your OS?
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft);
Just for testing try setting [char] instead of [const char] in configure.in:348.
Although I don't yet get confirmation on the above test, please test current CVS. There's a try-patch there. If it works, just let me know. -- Cheers Jorge.-
On Wed, Oct 22, 2008 at 12:09:10AM +0200, Ben de Groot wrote:
Jorge Arellano Cid wrote:
On Tue, Oct 21, 2008 at 07:39:51PM +0200, Ben de Groot wrote:
% grep inbuf_t work/dillo-2.0/config.log #define inbuf_t const char
It looks like the test in configure.in detects iconv() in a strange way.
Indeed, something seems to go wrong there. My glibc version is 2.8_p20080602.
What's inconv's signature in your OS?
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft);
Just for testing try setting [char] instead of [const char] in configure.in:348.
There's a patch in CVS. Please let me know if it works. -- Cheers Jorge.-
participants (5)
-
akemnade@tzi.de
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
yngwin@gentoo.org