From: Jim Meyering <meyering@redhat.com>
Date: Sat, 5 Sep 2009 17:54:12 +0000 (+0200)
Subject: syntax-check: detect unnecessary inclusion of openat.h
X-Git-Tag: v0.1~5533
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=77f13fca7be5bd73eb71c3be54fd752941914356;p=gnulib.git

syntax-check: detect unnecessary inclusion of openat.h

* top/maint.mk (sc_prohibit_openat_without_use): New rule.
---

diff --git a/ChangeLog b/ChangeLog
index 69c5c16572..c53c7f802e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-05  Jim Meyering  <meyering@redhat.com>
+
+	syntax-check: detect unnecessary inclusion of openat.h
+	* top/maint.mk (sc_prohibit_openat_without_use): New rule.
+
 2009-09-05  Bruno Haible  <bruno@clisp.org>
 
 	Support towlower, towupper.
diff --git a/top/maint.mk b/top/maint.mk
index 929d8c3bcd..45bc0c9c1b 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -293,6 +293,11 @@ sc_prohibit_root_dev_ino_without_use:
 	re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
 	  $(_header_without_use)
 
+sc_prohibit_openat_without_use:
+	@h='"openat.h"' \
+	re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?ch(own|mod)at)\>' \
+	  $(_header_without_use)
+
 # Prohibit the inclusion of c-ctype.h without an actual use.
 ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
 |isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper