write-only variables in src/sys/ - possible bugs
thompsa at FreeBSD.org
Mon Feb 2 11:58:16 PST 2009
On Mon, Feb 02, 2009 at 08:42:32PM +0100, Christoph Mallon wrote:
> 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;
> return 0;
> The list contains about 700 entries. About three dozen concern variables
> named 'error'. Here's one *example* from the list:
> 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.
> You can find the list here:
> The list was generated by cparser, a C99 compiler, which uses libFIRM for
> optimisation and code generation (lang/cparser in the ports).
This is helpful, my only nit would be to run it through sort. :)
More information about the freebsd-current