Little script

Marcin Dalecki (dalecki@sub994.sub.uni-goettingen.de)
Thu, 25 Sep 1997 12:45:33 +0200 (MET DST)


And here follows some magic which is highly recommended for anybody
interrested in maintaining good code qulity :-).

Supposedly with little extension this could be something interresting for
the 2 cent tip section of the linux gazette too.

Please apply it from time to time to the compiled kernel source. The
results are be interresting to see. This way I found for example that the
bcopy implementation is still lurking around in the kernel, without beeing
used anymore...

As of the gcc warning debatte:
This is the kind of code which should be used instead of many of the
useless/annoying warnings generated by the compiler.

===================================START OF SCRIPT=======================
#!/bin/sh
# (C)1997 by Marcin Dalecki
#
# This script will let You know if there are global symbols in the
# current directory tree, which are not refferenced anywhere.
# That's in esp. handy to find dead code...
#
# The grep command in the pipe below will let You forget about
# symbols used by the module interface.
#
find ./ -name "*.o" -exec nm -g {} 2>/dev/null \; | cut -c10- | \
grep -v '^?' | sort +1 -t' ' | uniq -u -1
====================================END OF SCRIPT========================

Marcin