[sane-devel] Compilation warnings
Henning Meier-Geinitz
henning at meier-geinitz.de
Sun Nov 17 19:47:39 GMT 2002
Hi,
On Sun, Nov 17, 2002 at 09:52:11AM +0100, Peter Kirchgessner wrote:
> I fear the top-leader of the warnings (hp-option.c) will stay on the
> list. Most of the warnings are "unused parameters". This is because the
> functions are called through a single function pointer. And some of the
> functions really don't use the parameter. A solution could be to add
> global variables to which the unused parameters are assigned. This is
> what I dont't want to do.
> Any other solution without adding dummy code just to satisfy the compiler ?
You could do something like:
unused_parameter = unused_parameter;
Probably that's optimized away by the compiler but it's still ugly in
the code.
There was a discussion of the UNUSEDARG used by some backends on the
list. If you use that and make sure it's defined for other compliers
than gcc it will work, too. And it's less ugly. See e.g. gphoto.
Bye,
Henning
More information about the sane-devel
mailing list