diff options
author | Jim Meyering <jim@meyering.net> | 2004-04-27 17:03:58 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-04-27 17:03:58 +0000 |
commit | ee5d9d5b143ace5c5d58c98665f603b38d239819 (patch) | |
tree | bc9cc7a3ffedc6e7ddb17da57b54fd6144ec95f9 | |
parent | 74a28492df25785ae460ccd447fced61fc8679d6 (diff) | |
download | coreutils-ee5d9d5b143ace5c5d58c98665f603b38d239819.tar.xz |
(sc_tight_scope): Also check for global variables, (BSS section).
-rw-r--r-- | src/Makefile.am | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index dbe7172a6..463422398 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -278,6 +278,8 @@ s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}' # Any that don't must be marked with `extern', but `main' # and `usage' are exceptions. They're always extern, but # don't need to be marked. +# +# The second nm|grep checks for file-scope variables with `extern' scope. sc_tight_scope: $(all_programs) @t=exceptions-$$$$; \ trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \ @@ -288,4 +290,10 @@ sc_tight_scope: $(all_programs) | sed -n 's/.* T //p' \ | grep -Ev -f $$t && \ { echo 'the above functions should have static scope' 1>&2; \ + exit 1; } || : ; \ + printf '^program_name$$\n' > $$t; \ + nm -e *.$(OBJEXT) \ + | sed -n 's/.* B //p' \ + | grep -Ev -f $$t && \ + { echo 'the above variables should have static scope' 1>&2; \ exit 1; } || : |