building Dillo 0.8.5 with Compaq's C Compiler on FreeBSD/Alpha
Hi all! Dillo 0.8.5 doesn't compile "out-of-the-box" with Compaq's C Compiler on FreeBSD/Alpha. The Dillo source code seems to be quite portable and clean as it is, so only very minor changes were necessary to make it build and run. It's probably a very uncommon compiler scenario, but I thought I'd still share this with the list. Perhaps it is of interest to someone. 1. src/dw_embed_gtk.h, line 27: /*gboolean child_size_request_lock*/; CCC doesn't like the semi-colon being outside the comment. Moving it inside allows the compilation to continue. 2. Lines 379-380 in src/dw_widget.h do not work with CCC. #define a_Dw_iterator_unhighlight(it, l) ((it) ? \ (it)->highlight(it, -1, -1, l) : FALSE) highlight() seems to return a void, which is not the same type as FALSE. I am not sure what the correct solution would be, but changing line 380 into the following will at least allow the compilation continue: ((it)->highlight(it, -1, -1, l), TRUE) : FALSE) 3. Line 134 in src/html.c. CCC says 'The static declaration of "Tags" is a tentative definition and specifies an incomplete type. (incompstat)' Removing the 'static' so that the line reads just const TagInfo Tags[]; allows the compilation to continue. (Note that the actual definition of static const TagInfo Tags further down in html.c does _not_ need to be changed!) So far so good. With these modifications, LIBPTHREAD_LIBS="-lc_r" CC=ccc CFLAGS="-mcpu=pca56 -fast -O4 -g3" ./configure; make builds everything. However, Dillo crashes when run. I spent some time trying to track down what causes this, and it seems to be the debug macros. CCC gives about a million warnings about these, looking like this: cc: Warning: file.c, line 42: This parameter is not preceded by a comma. (missingcomma) #define _MSG(fmt...) ----------------^ cc: Warning: file.c, line 905: Too few actual parameters in the invocation of the macro "MSG". (toofewactuals) MSG("file.dpi:: Failed to parse 'url'\n"); and so on. Apparently, either CCC is flawed in this regard, or the MSG macros were not written cleanly enough. Modifying src/msg.h and src/debug.h so that all MSG and DEBUG_MSG macros simply become empty statements, also changing the BW_MSG define in src/IO/http.c into an empty definition "avoids" the problem, Dillo seems to run fine, but of course there will be no debug output. :-/ The compiler version I used was "V6.4-005 on Linux 2.4.2 alpha", and the host OS was FreeBSD/Alpha 4.9. Perhaps some of these modifications could apply to the current CVS tree as well, and not just 0.8.5, but I haven't had time to check. Anders
On Sun, Nov 06, 2005 at 10:25:02AM +0100, Anders Gavare wrote:
Hi all!
Hi.
Dillo 0.8.5 doesn't compile "out-of-the-box" with Compaq's C Compiler on FreeBSD/Alpha. The Dillo source code seems to be quite portable and clean as it is, so only very minor changes were necessary to make it build and run. It's probably a very uncommon compiler scenario, but I thought I'd still share this with the list. Perhaps it is of interest to someone.
1. src/dw_embed_gtk.h, line 27:
/*gboolean child_size_request_lock*/;
CCC doesn't like the semi-colon being outside the comment. Moving it inside allows the compilation to continue.
Done.
2. Lines 379-380 in src/dw_widget.h do not work with CCC.
#define a_Dw_iterator_unhighlight(it, l) ((it) ? \ (it)->highlight(it, -1, -1, l) : FALSE)
highlight() seems to return a void, which is not the same type as FALSE. I am not sure what the correct solution would be, but changing line 380 into the following will at least allow the compilation continue:
((it)->highlight(it, -1, -1, l), TRUE) : FALSE)
I changed it to: ((it)->highlight(it, -1, -1, l), TRUE) : (void)0)
3. Line 134 in src/html.c. CCC says 'The static declaration of "Tags" is a tentative definition and specifies an incomplete type. (incompstat)' Removing the 'static' so that the line reads just
const TagInfo Tags[];
allows the compilation to continue. (Note that the actual definition of static const TagInfo Tags further down in html.c does _not_ need to be changed!)
... but gcc complains with that change: html.c:4318: error: static declaration of 'Tags' follows non-static declaration html.c:134: error: previous declaration of 'Tags' was here html.c:134: warning: array 'Tags' assumed to have one element so I left it unchanged.
So far so good. With these modifications, LIBPTHREAD_LIBS="-lc_r" CC=ccc CFLAGS="-mcpu=pca56 -fast -O4 -g3" ./configure; make builds everything.
However, Dillo crashes when run. I spent some time trying to track down what causes this, and it seems to be the debug macros. CCC gives about a million warnings about these, looking like this:
cc: Warning: file.c, line 42: This parameter is not preceded by a comma. (missingcomma) #define _MSG(fmt...) ----------------^
cc: Warning: file.c, line 905: Too few actual parameters in the invocation of the macro "MSG". (toofewactuals) MSG("file.dpi:: Failed to parse 'url'\n");
and so on. Apparently, either CCC is flawed in this regard, or the MSG macros were not written cleanly enough. Modifying src/msg.h and src/debug.h so that all MSG and DEBUG_MSG macros simply become empty statements, also changing the BW_MSG define in src/IO/http.c into an empty definition "avoids" the problem, Dillo seems to run fine, but of course there will be no debug output. :-/
The "fmt..." syntax is used to specify a function with a variable number of arguments. Try to find how it's done with CCC.
The compiler version I used was "V6.4-005 on Linux 2.4.2 alpha", and the host OS was FreeBSD/Alpha 4.9. Perhaps some of these modifications could apply to the current CVS tree as well, and not just 0.8.5, but I haven't had time to check.
Please try the current CVS and tell me if at least what's changed works. If you find a portable way to solve the othe problems, just let me know. -- Cheers Jorge.-
participants (2)
-
Anders Gavare
-
Jorge Arellano Cid