[elinks-dev] [patch] compilation errors with colourful -dump

Kalle Olavi Niemitalo kon at iki.fi
Sun Mar 12 12:56:28 PST 2006


The attached patch fixes these bugs in the colourful -dump code:

1. If neither CONFIG_88_COLORS nor CONFIG_256_COLORS is defined,
   then dump_to_file_256 is defined in dump.c but not used.
   If configure --enable-debug was used, then gcc warns about
   the unused function, and the warning stops the build.

2. The description of document.dump.color_mode ends with a
   newline, provoking a runtime warning from check_description
   in src/config/options.c.

3. options.inc has preprocessor directives inside macro arguments.
   That is not portable C.  xgettext (GNU gettext-tools) 0.14.3 is
   not smart enough to figure out the possible combinations, and
   copies an incorrect string to elinks.pot.

Some output resulting from these bugs:

make -C dump all
make[6]: Entering directory `/home/kalle/build/i686-pc-linux-gnu/elinks/src/viewer/dump'
gcc -DHAVE_CONFIG_H -I../../.. -I/home/kalle/src/elinks/src -O0 -ggdb -Wall -Wno-unused -Wall -Werror -fno-strict-aliasing -Wno-pointer-sign -o dump.o -c /home/kalle/src/elinks/src/viewer/dump/dump.c
cc1: warnings being treated as errors
/home/kalle/src/elinks/src/viewer/dump/dump.c:539: warning: ‘dump_to_file_256’ defined but not used
make[6]: *** [dump.o] Error 1
make[6]: Leaving directory `/home/kalle/build/i686-pc-linux-gnu/elinks/src/viewer/dump'

DEBUG MESSAGE at /home/kalle/src/elinks/src/config/options.c:120: bad char at end of description [Color mode for dumps:
-1 is standard dump mode
0 is mono mode
1 is 16 color mode
]

In my opinion, it's bad to make the meanings of possible values
of document.dump.color_mode vary depending on how ELinks was
configured.  It would be better to always have the same meanings,
and then document which of them the executable does not support
and what it will do instead.  However, I made no attempt to fix
that in the patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: elinks.dump.diff
Type: text/x-patch
Size: 3431 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-dev/attachments/20060312/28a7985f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/elinks-dev/attachments/20060312/28a7985f/attachment.sig>


More information about the elinks-dev mailing list