coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: fixes to support improved sc_tight_scope


From: Pádraig Brady
Subject: [PATCH] maint: fixes to support improved sc_tight_scope
Date: Sun, 18 Oct 2015 22:29:18 +0100

The gnulib provided sc_tight_scope target was ineffective,
as it was checking against an invalid blank regular expression,
and thus ignoring any extern function issues.  This is now
fixed up in gnulib, and so we need to fix our scoping issues
before the next gnulib update.

* cfg.mk: Setup and document the tight_scope config variables
appropriately.
* src/selinux.h: Since declared in *_SOURCES, use the two line
form for the extern function declarations.
* src/set-fields.h: Add the extern declarations, and since declared
in noinst_HEADERS use the single line form.
---
 cfg.mk           | 14 ++++++++++----
 src/selinux.h    |  6 ++++--
 src/set-fields.h |  6 ++----
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index bc5a1e8..010a903 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -766,12 +766,18 @@ gnulib-tests_CFLAGS = $(GNULIB_TEST_WARN_CFLAGS)
 
 # Configuration to make the tight-scope syntax-check rule work with
 # non-recursive make.
-export _gl_TS_headers = $(srcdir)/cfg.mk
-_gl_TS_dir = .
-_gl_TS_obj_files = src/*.$(OBJEXT)
+# Note _gl_TS_headers use _single line_ extern function declarations,
+# while *_SOURCES use the _two line_ form.
+export _gl_TS_headers = $(noinst_HEADERS)
+# Add exceptions for --enable-single-binary renamed functions.
+_gl_TS_unmarked_extern_functions = main usage
+_gl_TS_unmarked_extern_functions += single_binary_main_.* _usage_.*
+# Headers to search for single line extern _data_ declarations.
 _gl_TS_other_headers = $(srcdir)/src/*.h src/*.h
-
 # Tell the tight_scope rule about an exceptional "extern" variable.
 # Normally, the rule would detect its declaration, but that uses a
 # different name, __clz_tab.
 _gl_TS_unmarked_extern_vars = factor_clz_tab
+# Other tight_scope settings
+_gl_TS_dir = .
+_gl_TS_obj_files = src/*.$(OBJEXT)
diff --git a/src/selinux.h b/src/selinux.h
index f9b3276..ed060f9 100644
--- a/src/selinux.h
+++ b/src/selinux.h
@@ -29,8 +29,10 @@ ignorable_ctx_err (int err)
 
 # if HAVE_SELINUX_SELINUX_H
 
-extern bool restorecon (char const *path, bool recurse, bool preserve);
-extern int defaultcon (char const *path, mode_t mode);
+extern bool
+restorecon (char const *path, bool recurse, bool preserve);
+extern int
+defaultcon (char const *path, mode_t mode);
 
 # else
 
diff --git a/src/set-fields.h b/src/set-fields.h
index 2c55c29..216cdc4 100644
--- a/src/set-fields.h
+++ b/src/set-fields.h
@@ -39,11 +39,9 @@ enum
 };
 
 /* allocates and initializes the FRP array and N_FRP count */
-void
-set_fields (const char *fieldstr, unsigned int options);
+extern void set_fields (const char *fieldstr, unsigned int options);
 
 /* frees memory allocated by set_fields() */
-void
-reset_fields (void);
+extern void reset_fields (void);
 
 #endif
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]