diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-06-24 06:27:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-06-24 06:27:30 +0000 |
commit | fe082a8ff518a5e5ce574e6da40c3c05aed99947 (patch) | |
tree | bbe62b8308bbc4f82eded3023b73bbddb00ba3b4 /source3/script/findstatic.sh | |
parent | 4f7a02d5ded64e8c845f0c094a58be5bfb0171e8 (diff) | |
download | samba-fe082a8ff518a5e5ce574e6da40c3c05aed99947.tar.gz samba-fe082a8ff518a5e5ce574e6da40c3c05aed99947.tar.bz2 samba-fe082a8ff518a5e5ce574e6da40c3c05aed99947.zip |
much better findstatic script
(This used to be commit 2947b7624f921032bcd2cc5507747b2f7ef190de)
Diffstat (limited to 'source3/script/findstatic.sh')
-rwxr-xr-x | source3/script/findstatic.sh | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/source3/script/findstatic.sh b/source3/script/findstatic.sh deleted file mode 100755 index 39c57a46f7..0000000000 --- a/source3/script/findstatic.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# find a list of fns and variables in the code that could be static -# Andrew Tridgell <tridge@samba.org> - -# rather linux specific, but that doesn't matter in this case -# also very slow (order is N^2) but fast enough for this project - -declare -a FNS - -for f in $@; do - echo "Checking in $f" - T_FNS=`nm $f | grep ' T ' | cut -d' ' -f3` - C_FNS=`nm $f | egrep ' [DC] ' | cut -d' ' -f3` - if [ "$T_FNS" = "" -a "$C_FNS" = "" ]; then - echo "No public functions or data in $f" - continue - fi - for fn in $T_FNS; do - if [ $fn = "main" ]; then - continue - fi - found=0 - for f2 in $@; do - if [ $f != $f2 ]; then - FNS2=`nm $f2 | egrep ' U ' | awk '{print $2}'` - for fn2 in $FNS2; do - if [ $fn2 = $fn ]; then - found=1 - break - fi - done - fi - done - if [ $found = 0 ]; then - echo "Global function $fn is unique to $f" - fi - done - - for fn in $C_FNS; do - if [ $fn = "main" ]; then - continue - fi - found=0 - for f2 in $@; do - if [ $f != $f2 ]; then - FNS2=`nm $f2 | grep ' U ' | awk '{print $2}'` - for fn2 in $FNS2; do - if [ $fn2 = $fn ]; then - found=1 - break - fi - done - fi - done - if [ $found = 0 ]; then - echo "Global variable $fn is unique to $f" - fi - done -done |