Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Compile warnings using CFLAGS '-Wshadow -Wpointer-arith -Wca

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 23 Jun 2008 13:01:29 -0700
John Smith wrote:

Ive just compiled wireshark, and when adding the CFLAGS '-Wshadow
-Wpointer-arith -Wcast-qual -W -Wall'

What version of Wireshark are you building? With GCC, -Wall, -W, and -Wpointer-arith are by default added if the compiler supports them; -Wcast-qual is added with --enable-extra-gcc-checks as a configure-script argument.

-Wshadow wasn't there; I've checked in a change to add it by default if the compiler supports it.

'foo' defined but not used

Most of those come from the ASN.1 dissector generator, which, for some reason, seems to generate a lot of unused routines (is that an error in the ASN.1, or an error in asn2wrs?).

Our buildbot does builds with -Werror turned on (but without the extra GCC checks) for a number of files, which catches "defined but not used" errors in those files. Most if not all of the remaining ones come from machine-generated code.

Perhaps some of these need to be looked into by the developers ?

Some probably should.