summaryrefslogtreecommitdiff
path: root/maint.mk
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-07-01 22:34:29 +0200
committerLudovic Courtès <ludo@gnu.org>2011-07-01 22:34:29 +0200
commit231c0e0e61fc4bdd69398e89084b7819f0420710 (patch)
tree097398cd884074bd1d62dfa592fbdd8eda0d9796 /maint.mk
parent97ec95b72873428f215a8a9892487c3a8435a754 (diff)
downloadguile-231c0e0e61fc4bdd69398e89084b7819f0420710.tar.gz
Update Gnulib to v0.0-5874-g7170ee0.
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk79
1 files changed, 47 insertions, 32 deletions
diff --git a/maint.mk b/maint.mk
index 6f6b8be39..e6e03a897 100644
--- a/maint.mk
+++ b/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='<assert.h>' re='\<assert *\(' $(_sc_header_without_use)
+ @h='assert.h' re='\<assert *\(' $(_sc_header_without_use)
# Prohibit the inclusion of close-stream.h without an actual use.
sc_prohibit_close_stream_without_use:
- @h='"close-stream.h"' re='\<close_stream *\(' $(_sc_header_without_use)
+ @h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use)
# Prohibit the inclusion of getopt.h without an actual use.
sc_prohibit_getopt_without_use:
- @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
+ @h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
# Don't include quotearg.h unless you use one of its functions.
sc_prohibit_quotearg_without_use:
- @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
+ @h='quotearg.h' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
# Don't include quote.h unless you use one of its functions.
sc_prohibit_quote_without_use:
- @h='"quote.h"' re='\<quote(_n)? *\(' $(_sc_header_without_use)
+ @h='quote.h' re='\<quote(_n)? *\(' $(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_long_options_without_use:
- @h='"long-options.h"' re='\<parse_long_options *\(' \
+ @h='long-options.h' re='\<parse_long_options *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_inttostr_without_use:
- @h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
+ @h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_ignore_value_without_use:
- @h='"ignore-value.h"' re='\<ignore_(value|ptr) *\(' \
+ @h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \
$(_sc_header_without_use)
# Don't include this header unless you use one of its functions.
sc_prohibit_error_without_use:
- @h='"error.h"' \
+ @h='error.h' \
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
$(_sc_header_without_use)
@@ -480,7 +480,7 @@ sc_prohibit_error_without_use:
_xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
_xa2 = X([CZ]|N?M)ALLOC
sc_prohibit_xalloc_without_use:
- @h='"xalloc.h"' \
+ @h='xalloc.h' \
re='\<($(_xa1)|$(_xa2)) *\('\
$(_sc_header_without_use)
@@ -491,46 +491,46 @@ clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
_hash_fn = \<($(_hash_re)) *\(
_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
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='\<posix2_version *\(' $(_sc_header_without_use)
+ @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
sc_prohibit_same_without_use:
- @h='"same.h"' re='\<same_name *\(' $(_sc_header_without_use)
+ @h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
sc_prohibit_hash_pjw_without_use:
- @h='"hash-pjw.h"' \
+ @h='hash-pjw.h' \
re='\<hash_pjw *\(' \
$(_sc_header_without_use)
sc_prohibit_safe_read_without_use:
- @h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
+ @h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
$(_sc_header_without_use)
sc_prohibit_argmatch_without_use:
- @h='"argmatch.h"' \
+ @h='argmatch.h' \
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
$(_sc_header_without_use)
sc_prohibit_canonicalize_without_use:
- @h='"canonicalize.h"' \
+ @h='canonicalize.h' \
re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode)' \
$(_sc_header_without_use)
sc_prohibit_root_dev_ino_without_use:
- @h='"root-dev-ino.h"' \
+ @h='root-dev-ino.h' \
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
$(_sc_header_without_use)
sc_prohibit_openat_without_use:
- @h='"openat.h"' \
+ @h='openat.h' \
re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>' \
$(_sc_header_without_use)
@@ -538,7 +538,7 @@ sc_prohibit_openat_without_use:
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
sc_prohibit_c_ctype_without_use:
- @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' \
+ @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \
$(_sc_header_without_use)
_empty =
@@ -574,50 +574,56 @@ _sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_consts)))
# Prohibit the inclusion of signal.h without an actual use.
sc_prohibit_signal_without_use:
- @h='<signal.h>' \
+ @h='signal.h' \
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) *\(' \
+ @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 *\(' \
+ @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:
- @h='<strings.h>' \
+ @h='strings.h' \
re='\<(strn?casecmp|ffs(ll)?)\>' \
$(_sc_header_without_use)
# Get the list of symbol names with this:
-# perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
+# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt
_intprops_names = \
TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT \
TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM \
- INT_STRLEN_BOUND INT_BUFSIZE_BOUND
+ INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND \
+ INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW \
+ INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW \
+ INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW \
+ INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \
+ INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW \
+ INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW
_intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
# Prohibit the inclusion of intprops.h without an actual use.
sc_prohibit_intprops_without_use:
- @h='"intprops.h"' \
+ @h='intprops.h' \
re='\<($(_intprops_syms_re)) *\(' \
$(_sc_header_without_use)
_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
# Prohibit the inclusion of stddef.h without an actual use.
sc_prohibit_stddef_without_use:
- @h='<stddef.h>' \
+ @h='stddef.h' \
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='\<xfreopen *\(' $(_sc_header_without_use)
+ @h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use)
sc_obsolete_symbols:
@prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
@@ -1106,6 +1112,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 \
@@ -1133,6 +1140,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) \