X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=top%2Fmaint.mk;h=d364934549eb2efa3f1c535891a33388e521e81c;hb=6add58a9a1e2531ac96079cc063201ef3b3c2b98;hp=c55571cb47fa589777128daedab943f397db887b;hpb=1b20f727196f5f3361c2edf5ca28ac0032425706;p=gnulib.git diff --git a/top/maint.mk b/top/maint.mk index c55571cb4..d36493454 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -405,11 +405,11 @@ sc_prohibit_HAVE_MBRTOWC: $(_sc_search_regexp) # To use this "command" macro, you must first define two shell variables: -# h: the header, enclosed in <> or "" +# h: the header name, with no enclosing <> or "" # re: a regular expression that matches IFF something provided by $h is used. define _sc_header_without_use dummy=; : so we do not need a semicolon before each use; \ - h_esc=`echo "$$h"|sed 's/\./\\\\./g'`; \ + h_esc=`echo '[<"]'"$$h"'[">]'|sed 's/\./\\\\./g'`; \ if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \ files=$$(grep -l '^# *include '"$$h_esc" \ $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \ @@ -422,42 +422,42 @@ endef # Prohibit the inclusion of assert.h without an actual use of assert. sc_prohibit_assert_without_use: - @h='' re='\ sc_prohibit_hash_without_use: - @h='"hash.h"' \ + @h='hash.h' \ re='$(_hash_fn)|$(_hash_struct)'\ $(_sc_header_without_use) sc_prohibit_cloexec_without_use: - @h='"cloexec.h"' re='\<(set_cloexec_flag|dup_cloexec) *\(' \ + @h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \ $(_sc_header_without_use) sc_prohibit_posixver_without_use: - @h='"posixver.h"' re='\' \ @@ -684,11 +696,16 @@ sc_two_space_separator_in_usage: halt='help2man requires at least two spaces between an option and its description'\ $(_sc_search_regexp) +# A regexp matching function names like "error" that may be used +# to emit translatable messages. +_gl_translatable_diag_func_re ?= error + # Look for diagnostics that aren't marked for translation. # This won't find any for which error's format string is on a separate line. sc_unmarked_diagnostics: @grep -nE \ - '\&2; \ exit 1; } || : @@ -735,7 +752,8 @@ gl_other_headers_ ?= \ gl_extract_significant_defines_ = \ /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\ && $$2 !~ /(?:rpl_|_used_without_)/\ - && $$1 !~ /^(?:NSIG|ATTRIBUTE_NORETURN)$$/\ + && $$1 !~ /^(?:NSIG)$$/\ + && $$1 !~ /^(?:SA_RESETHAND|SA_RESTART)$$/\ and print $$1 # Create a list of regular expressions matching the names @@ -747,7 +765,6 @@ define def_sym_regex perl -lne '$(gl_extract_significant_defines_)' $$f; \ done; \ ) | sort -u \ - | grep -Ev '^ATTRIBUTE_NORETURN' \ | sed 's/^/^ *# *(define|undef) */;s/$$/\\>/' endef @@ -1101,6 +1118,7 @@ sc_copyright_check: # the other init.sh-using tests also get it right. _hv_file ?= $(srcdir)/tests/help-version _hv_regex_weak ?= ^ *\. .*/init\.sh" +# Fix syntax-highlighters " _hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh" sc_cross_check_PATH_usage_in_tests: @if test -f $(_hv_file); then \ @@ -1128,6 +1146,14 @@ sc_Wundef_boolean: halt='Use 0 or 1 for macro values' \ $(_sc_search_regexp) +# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might +# not be constant, or might overflow a stack. In general, use PATH_MAX as +# a limit, not an array or alloca size. +sc_prohibit_path_max_allocation: + @prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX' \ + halt='Avoid stack allocations of size PATH_MAX' \ + $(_sc_search_regexp) + sc_vulnerable_makefile_CVE-2009-4029: @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \ in_files=$$(find $(srcdir) -name Makefile.in) \ @@ -1401,7 +1427,7 @@ ifeq (a,b) # 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 ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) +\(/ +_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) *\(/ # If your project uses a macro like "XTERN", then put # the following in cfg.mk to override this default: