X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=top%2Fmaint.mk;h=c838516e548e983f8e9d3973fce60cd25568e018;hb=c9ff025783e5374226ffbf7940f40ce7db6852ed;hp=4088a791316a8abc056fbcc8b0448ae0f656fbd2;hpb=d48feb15b4580be907f374c5994c570176669a9e;p=gnulib.git diff --git a/top/maint.mk b/top/maint.mk index 4088a7913..c838516e5 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -568,6 +568,16 @@ sc_prohibit_signal_without_use: re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \ $(_sc_header_without_use) +# Don't include stdio--.h unless you use one of its functions. +sc_prohibit_stdio--_without_use: + @h='"stdio--.h"' re='\<((f(re)?|p)open|tmpfile) *\(' \ + $(_sc_header_without_use) + +# Don't include stdio-safer.h unless you use one of its functions. +sc_prohibit_stdio-safer_without_use: + @h='"stdio-safer.h"' re='\<((f(re)?|p)open|tmpfile)_safer *\(' \ + $(_sc_header_without_use) + # Prohibit the inclusion of strings.h without a sensible use. # Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible. sc_prohibit_strings_without_use: @@ -595,6 +605,10 @@ sc_prohibit_stddef_without_use: re='\<($(_stddef_syms_re)) *\(' \ $(_sc_header_without_use) +# Don't include xfreopen.h unless you use one of its functions. +sc_prohibit_xfreopen_without_use: + @h='"xfreopen.h"' re='\' \ halt='do not use HAVE''_FCNTL_H or O'_NDELAY \ @@ -646,12 +660,6 @@ sc_require_test_exit_idiom: exit 1; } || :; \ fi -sc_the_the: - @prohibit='\' \ - ignore_case=1 \ - halt='found use of "the ''the";' \ - $(_sc_search_regexp) - sc_trailing_blank: @prohibit='[ ]$$' \ halt='found trailing blank(s)' \ @@ -1368,13 +1376,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 @@ -1397,7 +1408,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)' \ @@ -1406,7 +1417,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' \