check_config_macros.pl (285B)
1 #!/usr/bin/perl -w 2 3 use strict; 4 5 my @macros = (); 6 7 open(F, 'orconfig.h.in'); 8 while(<F>) { 9 if (/^#undef +([A-Za-z0-9_]*)/) { 10 push @macros, $1; 11 } 12 } 13 close F; 14 15 for my $m (@macros) { 16 my $s = `git grep '$m' src`; 17 if ($s eq '') { 18 print "Unused: $m\n"; 19 } 20 }