2 # Script that reads in C files and prints defines that are used nowhere in the
5 # Arguments: C and H files
6 # Copyright Jelmer Vernooij <jelmer@samba.org>, GPL
23 if(/^#define ([A-Za-z0-9_]+)/) {
24 $defined{$1} = "$tmp:$ln";
29 while(/([A-Za-z0-9_]+)/sgm) {
30 if($cur ne $1) { $used{$1} = "$tmp:$ln"; }
36 foreach(keys %defined) {
37 if(!$used{$_}) { print "$defined{$_}: Macro `$_' is unused\n"; }