From ee5d9d5b143ace5c5d58c98665f603b38d239819 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 27 Apr 2004 17:03:58 +0000 Subject: (sc_tight_scope): Also check for global variables, (BSS section). --- src/Makefile.am | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Makefile.am') 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; } || : -- cgit v1.2.3-70-g09d2