diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-05-17 19:08:14 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-05-18 10:53:54 +0100 |
commit | 00667b211fb2ea8f53cf5af2c0231e67257f0d86 (patch) | |
tree | 6bd8496a850d649544d0c38a8f664363327656ad /top | |
parent | a2b658cdccd4a13a5cef87144447f96cd1079e8c (diff) | |
download | gnulib-00667b211fb2ea8f53cf5af2c0231e67257f0d86.tar.gz |
maint.mk: exclude compiler symbols from sc_tight_scope
Diffstat (limited to 'top')
-rw-r--r-- | top/maint.mk | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/top/maint.mk b/top/maint.mk index 0f097d1235..d0d33e4dad 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -1362,13 +1362,16 @@ ifeq (a,b) # Most functions should have static scope. # Any that don't must be marked with `extern', but `main' # and `usage' are exceptions: they're always extern, but -# do not need to be marked. +# do not need to be marked. Symbols matching `__.*' are +# reserved by the compiler, so are automatically excluded below. _gl_TS_unmarked_extern_functions ?= main usage _gl_TS_function_match ?= \ /^(?:extern|XTERN) +(?:void|(?:struct |const |enum )?\S+) +\**(\S+) +\(/ # The second nm|grep checks for file-scope variables with `extern' scope. # Without gnulib's progname module, you might put program_name here. +# Symbols matching `__.*' are reserved by the compiler, +# so are automatically excluded below. _gl_TS_unmarked_extern_vars ?= # NOTE: the _match variables are perl expressions -- not mere regular @@ -1391,7 +1394,7 @@ _gl_tight_scope: $(bin_PROGRAMS) test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ hdr=`for f in $(noinst_HEADERS); do \ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ - ( printf '^%s$$\n' $(_gl_TS_unmarked_extern_functions); \ + ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ grep -h -A1 '^extern .*[^;]$$' $$src \ | grep -vE '^(extern |--)' | sed 's/ .*//'; \ perl -lne '$(_gl_TS_function_match)' \ @@ -1400,7 +1403,7 @@ _gl_tight_scope: $(bin_PROGRAMS) nm -e *.$(OBJEXT) | sed -n 's/.* T //p' | grep -Ev -f $$t \ && { echo the above functions should have static scope >&2; \ exit 1; } || : ; \ - ( printf '^%s$$\n' $(_gl_TS_unmarked_extern_vars); \ + ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \ perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' \ $$hdr *.h ) | sort -u > $$t; \ nm -e *.$(OBJEXT) | sed -n 's/.* [BCDGRS] //p' \ |