I've just pushed the following three patches:
From 30b2a6a9ef73e8929afb0cc1c0fc5295dabf6479 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@fb.com>
Date: Thu, 24 Sep 2015 17:03:20 +0100
Subject: [PATCH 1/3] ChangeLog: fix typo: s/cound/count/

---
 ChangeLog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ea19d9e..bc71d2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5898,7 +5898,7 @@ o	Test only that noncanonical values do not cause crashes, not that
 	file system's timestamp jumps; this should be more reliable.
 	Look at both mtime and ctime, and take the maximum of the two jumps.
 	(nap_works, guess_delay):
-	Return a nanosecond cound, not a microsecond count.
+	Return a nanosecond count, not a microsecond count.
 	All callers changed.
 	(nap_works, nap): Use nanosleep, not usleep.  Check for nanosleep
 	failure.
-- 
2.6.0

From 3ef58f46faf45a574ffe583e206715787ab283f2 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@fb.com>
Date: Sat, 17 Oct 2015 20:12:48 -0700
Subject: [PATCH 2/3] maint.mk: sc_tight_scope: factor and support OS X

* top/maint.mk (_gl_tight_scope): Address three issues:
- factor out four instances of code that wraps a string in "^...$"
- allow nm-reported symbol names to have an optional leading "_"
- add "main" to the list of ignored variable names, because on os x,
"main" has nm-reported type "S" in the variable-checking section.
---
 ChangeLog    |  9 +++++++++
 top/maint.mk | 13 +++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc71d2e..7dafb8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-10-17  Jim Meyering  <meyer...@fb.com>
+
+	maint.mk: sc_tight_scope: factor and support OS X
+	* top/maint.mk (_gl_tight_scope): Address three issues:
+	- factor out four instances of code that wraps a string in "^...$"
+	- allow nm-reported symbol names to have an optional leading "_"
+	- add "main" to the list of ignored variable names, because on os x,
+	"main" has nm-reported type "S" in the variable-checking section.
+
 2015-10-16  Dmitry Smirnov  <only...@member.fsf.org>

 	safe-alloc-tests: fix typo in license header
diff --git a/top/maint.mk b/top/maint.mk
index b6ec1b5..6fb6d84 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1633,6 +1633,7 @@ _gl_TS_other_headers ?= *.h

 .PHONY: _gl_tight_scope
 _gl_tight_scope: $(bin_PROGRAMS)
+	sed_wrap='s/^/^_?/;s/$$/$$/';					\
 	t=exceptions-$$$$;						\
 	trap 's=$$?; rm -f $$t; exit $$s' 0;				\
 	for sig in 1 2 3 13 15; do					\
@@ -1642,19 +1643,19 @@ _gl_tight_scope: $(bin_PROGRAMS)
 	       test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`;	\
 	hdr=`for f in $(_gl_TS_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) and print "^$$1\$$"' $$hdr;	\
-	) | sort -u > $$t;						\
+	     '$(_gl_TS_function_match) and print $$1' $$hdr;		\
+	) | sort -u | $(SED) "$$sed_wrap" > $$t;			\
 	nm -g $(_gl_TS_obj_files)|$(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);	\
-	  perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"'		\
+	( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars);	\
+	  perl -lne '$(_gl_TS_var_match) and print $$1'			\
 		$$hdr $(_gl_TS_other_headers)				\
-	) | sort -u > $$t;						\
+	) | sort -u | $(SED) "$$sed_wrap" > $$t;			\
 	nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p'	\
             | sort -u | grep -Ev -f $$t					\
 	  && { echo the above variables should have static scope >&2;	\
-- 
2.6.0

From 37c054af09357276eb560990eba1f20cdc489bfc Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@fb.com>
Date: Sat, 17 Oct 2015 19:18:01 -0700
Subject: [PATCH 3/3] maint.mk: _gl_TS_function_match: fix "extern" name
 extracting regexp

* top/maint.mk (_gl_TS_function_match): This heuristic extern-function-
name-extraction regexp mistakenly used \S+, and would mistakenly
extract "*F" from "extern int *F()" rather than the desired "F".
Use \w+ instead.
---
 ChangeLog    | 8 ++++++++
 top/maint.mk | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 7dafb8b..81f8cd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-10-17  Jim Meyering  <meyer...@fb.com>

+	maint.mk: _gl_TS_function_match: fix "extern" name extracting regexp
+	* top/maint.mk (_gl_TS_function_match): This heuristic extern-function-
+	name-extraction regexp mistakenly used \S+, and would mistakenly
+	extract "*F" from "extern int *F()" rather than the desired "F".
+	Use \w+ instead.
+
+2015-10-17  Jim Meyering  <meyer...@fb.com>
+
 	maint.mk: sc_tight_scope: factor and support OS X
 	* top/maint.mk (_gl_tight_scope): Address three issues:
 	- factor out four instances of code that wraps a string in "^...$"
diff --git a/top/maint.mk b/top/maint.mk
index 6fb6d84..4887e5d 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -1600,7 +1600,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)) +.*?(\w+) *\(/

 # If your project uses a macro like "XTERN", then put
 # the following in cfg.mk to override this default:
-- 
2.6.0

Reply via email to