--- Begin Message ---
Hello list.
As it turns out, on Solaris 9 it is impossible to compile current
tcpdump with CFLAGS=-Werror because missing/getopt_long.c yields a few
warnings (attached). As far as the current revisions of this file go in
FreeBSD, NetBSD and OpenBSD, FreeBSD seems to be the closest and just a
bit newer than the current tcpdump copy (OpenBSD revision 1.22 -> 1.26).
However, it seems unlikely that porting the newer revision would make
the warnings go away, because, for example, permute_args() has not
changed at all.
The same problem stands on AIX 7, and in addition there is an issue
specific to XL C compiler, in that ./configure detects that the
compiler does not support -W, but then proceeds to flex every -Wxxxx
option anyway, which the compiler treats as a soft error, so ./configure
takes each option as supported, so at the compile time every -Wxxxx
option ends up in CFLAGS, so for every .c file xlc yields 15 warnings
(see attached). It works, but looks messy.
So for now the build matrix scripts do not specify -Werror for these
two cases. There are more related corner cases of varying severity,
some of which I might have time to describe later.
Cheers.
--
Denis Ovsienko
./missing/getopt_long.c: In function 'permute_args':
./missing/getopt_long.c:163:5: error: cast discards '__attribute__((const))'
qualifier from pointer target type [-Werror=cast-qual]
./missing/getopt_long.c:165:5: error: cast discards '__attribute__((const))'
qualifier from pointer target type [-Werror=cast-qual]
./missing/getopt_long.c: In function 'parse_long_options':
./missing/getopt_long.c:295:14: error: cast discards '__attribute__((const))'
qualifier from pointer target type [-Werror=cast-qual]
./missing/getopt_long.c: In function 'getopt_internal':
./missing/getopt_long.c:547:13: error: cast discards '__attribute__((const))'
qualifier from pointer target type [-Werror=cast-qual]
cc1: all warnings being treated as errors
*** Error code 1
The following command caused the error:
gcc -std=gnu99 -W -Wall -Wcast-qual -Wmissing-prototypes -Wold-style-definition
-Wpointer-arith -Wpointer-sign -Wshadow -Wsign-compare -Wstrict-prototypes
-Wwrite-strings -DHAVE_CONFIG_H -I. -I../libpcap -Werror -o getopt_long.o -c
./missing/getopt_long.c
make: Fatal error: Command failed for target `getopt_long.o'
checking whether the compiler fails when given an unknown warning option... no
checking whether the compiler supports the -W option... no
checking whether the compiler supports the -Wall option... yes
checking whether the compiler supports the -Wcomma option... yes
checking whether the compiler supports the -Wdocumentation option... yes
checking whether the compiler supports the -Wformat-nonliteral option... yes
checking whether the compiler supports the -Wmissing-noreturn option... yes
checking whether the compiler supports the -Wmissing-prototypes option... yes
checking whether the compiler supports the -Wmissing-variable-declarations
option... yes
checking whether the compiler supports the -Wpointer-arith option... yes
checking whether the compiler supports the -Wpointer-sign option... yes
checking whether the compiler supports the -Wshadow option... yes
checking whether the compiler supports the -Wsign-compare option... yes
checking whether the compiler supports the -Wstrict-prototypes option... yes
checking whether the compiler supports the -Wunused-parameter option... yes
checking whether the compiler supports the -Wused-but-marked-unused option...
yes
checking whether the compiler supports the -Wunreachable-code option... yes
checking whether -Wunreachable-code generates warnings from ntohs()... no
checking whether the compiler supports the -Wshorten-64-to-32 option... yes
xlc: 1501-289 (W) Option -Wcomma was incorrectly specified. The option will be
ignored.
xlc: 1501-289 (W) Option -Wdocumentation was incorrectly specified. The option
will be ignored.
xlc: 1501-289 (W) Option -Wformat-nonliteral was incorrectly specified. The
option will be ignored.
xlc: 1501-289 (W) Option -Wmissing-noreturn was incorrectly specified. The
option will be ignored.
xlc: 1501-289 (W) Option -Wmissing-prototypes was incorrectly specified. The
option will be ignored.
xlc: 1501-289 (W) Option -Wmissing-variable-declarations was incorrectly
specified. The option will be ignored.
xlc: 1501-289 (W) Option -Wpointer-arith was incorrectly specified. The option
will be ignored.
xlc: 1501-289 (W) Option -Wpointer-sign was incorrectly specified. The option
will be ignored.
xlc: 1501-289 (W) Option -Wshadow was incorrectly specified. The option will be
ignored.
xlc: 1501-289 (W) Option -Wsign-compare was incorrectly specified. The option
will be ignored.
xlc: 1501-289 (W) Option -Wstrict-prototypes was incorrectly specified. The
option will be ignored.
xlc: 1501-289 (W) Option -Wunused-parameter was incorrectly specified. The
option will be ignored.
xlc: 1501-289 (W) Option -Wused-but-marked-unused was incorrectly specified.
The option will be ignored.
xlc: 1501-289 (W) Option -Wunreachable-code was incorrectly specified. The
option will be ignored.
xlc: 1501-289 (W) Option -Wshorten-64-to-32 was incorrectly specified. The
option will be ignored.
--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers