Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 2009 13:35:44 -0800
From:      Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
To:        Christoph Mallon <christoph.mallon@gmx.de>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: write-only variables in src/sys/ - possible bugs
Message-ID:  <bb4a86c70902021335i4b3741a0h212fd64d47506f32@mail.gmail.com>
In-Reply-To: <49874CA8.5090605@gmx.de>
References:  <49874CA8.5090605@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 2, 2009 at 11:42 AM, Christoph Mallon
<christoph.mallon@gmx.de> wrote:
> Hi,
>
> I compiled a list of all local variables in src/sys/ (r188000), which are
> only written to, but never read. This is more than the GCC warning, which
> only complains about variables, which are only declared (and maybe
> initialised) and not used otherwise. In contrast this list contains
> variables with the following usage pattern:
>
> int w = 42; // GCC warns about this ...
> int x;      // ... but not this
> x = 23;
> x++;
> return 0;
>
> The list contains about 700 entries. About three dozen concern variables
> named 'error'. Here's one *example* from the list:
>
>        sys/dev/kbdmux/kbdmux.c:1304
>
> In the function kbdmux_modevent() the variable 'error' is assigned values
> eight times, but at the end of the function there is just a return 0; and
> the variable is never read. Probably the value should be returned.

fixed. thanks for reporting!

thanks,
max



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70902021335i4b3741a0h212fd64d47506f32>