[sane-devel] Some warnings/errors - please verify your backends

Olaf Meeuwissen olaf@epkowa.co.jp
27 Mar 2003 08:21:35 +0900


Oliver Rauch <oliver.rauch@rauch-domain.de> forwards:

> ----------  Forwarded Message  ----------
> 
> Subject: Re: Two small `sane' questions
> Date: Wed, 26 Mar 2003 16:08:00 -0500 (EST)
> From: der Mouse <mouse@Rodents.Montreal.QC.CA>
> To: Oliver Rauch <oliver.rauch@rauch-domain.de>
> 
> Okay, my rebuild is done.  Here are the warnings I got.
> 
> - A lot of "unused parameter" warnings.  I saw some SANE code that does
>   "var=var;" to quell such warnings, so presumably at least some people
>   care.

I've seen such code as well and find it horribly inelegant.  Any good
reasons why you can not replace:

  void useless_func( int unused_parameter )
  {
    unused_parameter = unused_parameter;
  }

with:

  void useless_func( int )
  {
  }

This gets rid of the "unused parameter" warnings just fine (with gcc
at least) and very clearly indicates that useless_func does not give
a damn about the parameter it gets passed.

-- 
Olaf Meeuwissen                            EPSON KOWA Corporation, ECS
GnuPG key: 6BE37D90/AB6B 0D1F 99E7 1BF5 EB97  976A 16C7 F27D 6BE3 7D90
Penguin's lib!       -- I hack, therefore I am --               LPIC-2