bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] maint.mk: also prohibit inclusion of dirent.h without use


From: Jim Meyering
Subject: [PATCH] maint.mk: also prohibit inclusion of dirent.h without use
Date: Sat, 05 Nov 2011 17:36:31 +0100

FYI,
Here's a probably-incomplete list of regexps for dirent.h.
But completeness is not that important: the cost of incompleteness
is merely the lack of warning about an unnecessary inclusion.

>From bc1c14f003edbadde570d0322433b6b961205340 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 5 Nov 2011 17:34:09 +0100
Subject: [PATCH] maint.mk: also prohibit inclusion of dirent.h without use

* top/maint.mk (sc_prohibit_dirent_without_use): New rule.
---
 ChangeLog    |    5 +++++
 top/maint.mk |   10 ++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bbb4c0b..616c5db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-05  Jim Meyering  <address@hidden>
+
+       maint.mk: also prohibit inclusion of dirent.h without use
+       * top/maint.mk (sc_prohibit_dirent_without_use): New rule.
+
 2011-11-05  Bruno Haible  <address@hidden>

        ldexpl tests: Avoid test failure on MSVC 9.
diff --git a/top/maint.mk b/top/maint.mk
index 72b7e06..9f4c032 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -625,6 +625,16 @@ sc_prohibit_stddef_without_use:
        re='\<($(_stddef_syms_re))\>'                                   \
          $(_sc_header_without_use)

+_de1 = dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)?
+_de2 = (versionsort|struct dirent|getdirentries|alphasort|scandir(at)?)(64)?
+_de3 = MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen
+_dirent_syms_re = $(_de1)|$(_de2)|$(_de3)
+# Prohibit the inclusion of dirent.h without an actual use.
+sc_prohibit_dirent_without_use:
+       h='dirent.h'                                                    \
+       re='\<($(_dirent_syms_re))\>'                                   \
+         $(_sc_header_without_use)
+
 # Prohibit the inclusion of verify.h without an actual use.
 sc_prohibit_verify_without_use:
        @h='verify.h'                                                   \
--
1.7.8.rc0.35.gee6df



reply via email to

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