Dillo does not compile with GCC v4.4.0. A patch is attached. --Tim
Hi Tim, On Thu, May 14, 2009 at 08:55:25PM +0000, Tim Nieradzik wrote:
Dillo does not compile with GCC v4.4.0. A patch is attached.
Cool. Thanks for the patch! One thing I don't see immediately is why a_Html_get_attr() must be changed to return char* instead of const char*. I would prefer to fix the callers of a_Html_get_attr() instead. Could you please post the compiler errors you get with current tip? Cheers, Johannes
I would prefer to fix the callers of a_Html_get_attr() instead.
Thanks, you are right. My patch was just a quick-and-dirty solution though. Certainly it can be done better.
Could you please post the compiler errors you get with current tip?
Yes, but I only can give you the first error. Otherwise I would need to apply the patch partially. But to get an idea of the issue, this should be sufficient yet (the other errors were quite similar). [...] mv -f .deps/table.Tpo .deps/table.Po g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -g -O2 -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -MT tablecell.o -MD -MP -MF .deps/tablecell.Tpo -c -o tablecell.o tablecell.cc tablecell.cc: In member function ?virtual void dw::TableCell::wordWrap(int)?: tablecell.cc:55: error: invalid conversion from ?const char*? to ?char*? make[2]: *** [tablecell.o] Error 1 [...] --Tim
Tim wrote:
I would prefer to fix the callers of a_Html_get_attr() instead.
Thanks, you are right. My patch was just a quick-and-dirty solution though. Certainly it can be done better.
Could you please post the compiler errors you get with current tip?
Yes, but I only can give you the first error. Otherwise I would need to apply the patch partially. But to get an idea of the issue, this should be sufficient yet (the other errors were quite similar).
[...] mv -f .deps/table.Tpo .deps/table.Po g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -g -O2 -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -MT tablecell.o -MD -MP -MF .deps/tablecell.Tpo -c -o tablecell.o tablecell.cc tablecell.cc: In member function ?virtual void dw::TableCell::wordWrap(int)?: tablecell.cc:55: error: invalid conversion from ?const char*? to ?char*? make[2]: *** [tablecell.o] Error 1 [...]
So these all boil down to GCC 4.4 wanting strchr and strrchr to return const char* when passed a const char* ?
On Fri, May 15, 2009 at 03:32:47PM +0000, corvid wrote:
Tim wrote:
I would prefer to fix the callers of a_Html_get_attr() instead.
Thanks, you are right. My patch was just a quick-and-dirty solution though. Certainly it can be done better.
Could you please post the compiler errors you get with current tip?
Yes, but I only can give you the first error. Otherwise I would need to apply the patch partially. But to get an idea of the issue, this should be sufficient yet (the other errors were quite similar).
[...] mv -f .deps/table.Tpo .deps/table.Po g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -g -O2 -Wall -W -Wno-unused-parameter -fno-rtti -fno-exceptions -MT tablecell.o -MD -MP -MF .deps/tablecell.Tpo -c -o tablecell.o tablecell.cc tablecell.cc: In member function ???virtual void dw::TableCell::wordWrap(int)???: tablecell.cc:55: error: invalid conversion from ???const char*??? to ???char*??? make[2]: *** [tablecell.o] Error 1 [...]
So these all boil down to GCC 4.4 wanting strchr and strrchr to return const char* when passed a const char* ?
Yes. It's concisely explained here: http://gcc.gnu.org/gcc-4.4/porting_to.html -- Cheers Jorge.-
On Thu, May 14, 2009 at 11:59:45PM +0200, Johannes Hofmann wrote:
Hi Tim,
On Thu, May 14, 2009 at 08:55:25PM +0000, Tim Nieradzik wrote:
Dillo does not compile with GCC v4.4.0. A patch is attached.
Cool. Thanks for the patch! One thing I don't see immediately is why a_Html_get_attr() must be changed to return char* instead of const char*. I would prefer to fix the callers of a_Html_get_attr() instead.
I Agree. Tim: can you provide access to a machine with gcc-4.4 to give this problem a hands-on try. If not, please try to get to a solution that keeps Html_get_attr2() const and that avoids C++ const_casts by declaring const char* locals. -- Cheers Jorge.-
[...] please try to get to a solution that keeps Html_get_attr2() const and that avoids C++ const_casts by declaring const char* locals.
See the attachments for the patch. It works fine here. Anyway, there are still some warnings when compiling the source: html.cc: In function ?void Html_tag_open_meta(DilloHtml*, const char*, int)?: html.cc:2792: attention : deprecated conversion from string constant to ?char*? form.cc: In member function ?Dstr* DilloHtmlForm::buildQueryData(DilloHtmlInput*)?: form.cc:1065: attention : deprecated conversion from string constant to ?char*? --Tim
participants (4)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
tim.nieradzik@gmx.de