diff options
author | Keith Bostic <keith@wiredtiger.com> | 2010-02-15 10:46:44 +1100 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2010-02-15 10:46:44 +1100 |
commit | 2d24e24b59de8e78d87768cf81cc0dbf619d1f37 (patch) | |
tree | 251c19603964b7279a2e7025e6c0b5c2fb0fc259 /dist/s_define | |
parent | 76c565580f9029883a1d13525705d655fbdb0d87 (diff) | |
download | mongo-2d24e24b59de8e78d87768cf81cc0dbf619d1f37.tar.gz |
Add a script to display unused #defines.
--HG--
branch : keith
Diffstat (limited to 'dist/s_define')
-rw-r--r-- | dist/s_define | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dist/s_define b/dist/s_define new file mode 100644 index 00000000000..2f2de993571 --- /dev/null +++ b/dist/s_define @@ -0,0 +1,28 @@ +#! /bin/sh +# +# $Id$ + +# Complain about unused #defines. +t=__wt.$$ +trap 'rm -f $t; exit 0' 0 1 2 3 13 15 + +( +sed '/^#/d' < s_define.list +for i in \ + `cat ../inc_posix/*.h ../inc_posix/*.in | + egrep '^#define' | + sed 's/#define[ ][ ]*\([A-Za-z_]*\).*/\1/' | + sort -u`; do + if `egrep "$i" ../*/*.c ../utilities/*/*.c > /dev/null`; then + continue + fi + echo $i +done +) | sort | uniq -u > $t + +test -s $t && { + echo 'Unused #defines:' + sed 's/^/ /' < $t +} + +exit 0 |