summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/Makefile.in10
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e97a5e9f1..a388a8cac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
* Version 5.3.0.
+ * src/ptx.c: Make over 40 global extern variables `static'.
+ (syntax_table, re_syntax_table): Remove declarations of two unused
+ variables (they were exposed by the above change).
+
* src/du.c (G_fail, opt_nul_terminate_output): Declare `static'.
* src/ln.c (backup_type): Likewise.
diff --git a/src/Makefile.in b/src/Makefile.in
index 0f2048664..f9bca9909 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1724,7 +1724,9 @@ check-misc:
# Any that don't must be marked with `extern', but `main'
# and `usage' are exceptions. They're always extern, but
# don't need to be marked.
-sc_src_functions_have_static_scope: $(all_programs)
+#
+# The second nm|grep checks for file-scope variables with `extern' scope.
+sc_tight_scope: $(all_programs)
@t=exceptions-$$$$; \
trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \
( printf '^main$$\n^usage$$\n'; \
@@ -1734,6 +1736,12 @@ sc_src_functions_have_static_scope: $(all_programs)
| sed -n 's/.* T //p' \
| grep -Ev -f $$t && \
{ echo 'the above functions should have static scope' 1>&2; \
+ exit 1; } || : ; \
+ printf '^program_name$$\n' > $$t; \
+ nm -e *.$(OBJEXT) \
+ | sed -n 's/.* B //p' \
+ | grep -Ev -f $$t && \
+ { echo 'the above variables should have static scope' 1>&2; \
exit 1; } || :
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.