Ethereal-dev: Re: [Ethereal-dev] unused variables in packet-dcerpc-XXX.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sat, 4 May 2002 04:12:00 -0700
On Sat, May 04, 2002 at 04:38:24AM +0200, Joerg Mayer wrote:
> If this patch is applied and Guy's patch to the plugin-generator for idl
> dissectors, the warning count should be sufficiently low to turn on
> unused warnings for everyone.

Well, applying the patch to the plugin generator for CORBA dissectors
isn't sufficient - you also have to regenerate the dissectors.

It appears to be a bit of a pain to get omniORB running on FreeBSD 3.4 -
you have to get EGCS installed, etc. - so I just updated the dissectors
by hand to match the changes.

This gets rid of most of the warnings.

However, it doesn't get rid of

	packet-cosnaming.c: In function `dissect_cosnaming':
	packet-cosnaming.c:1561: warning: unused variable `offset_saved'

and

	packet-coseventcomm.c: In function `dissect_coseventcomm':
	packet-coseventcomm.c:693: warning: unused variable `offset_saved'

"offset_saved" is defined in code in the "template_main_dissector_start"
variable in "ethereal_gen.py".

It's used by code in the first of two assignments to the
"template_main_dissector_switch_msgtype_end" variable.  However, unless
there's some Python subtlety I'm not seeing, that variable is never
*used*.

If so, then

	1) both assignments to that variable should presumably be
	   removed;

	2) the definition of "offset_saved" should presumably be removed
	   as well, as "ethereal_gen.py" no longer generates any code
	   that refers to it.

Frank, is that the case?

In any case, I've checked in some changes from one of Joerg's early
patches (after noticing that, in at least one case, the argument
*should* have been used - the ring buffer code wasn't checking for
"fflush()" failing, so I fixed it to do so and, if it fails, return an
error through the argument in question, rather than putting an _U_ for
that argument)...

...and checked in his change to get rid of "-Wno-unused".