bug-gnulib
[Top][All Lists]
Advanced

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

Re: sc_prohibit_stddef_without_use works incorrectly


From: Jim Meyering
Subject: Re: sc_prohibit_stddef_without_use works incorrectly
Date: Tue, 25 Oct 2011 15:49:45 +0200

Alfred M. Szmidt wrote:

> The following syntax-check is broken,
>
>    _stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
>    # Prohibit the inclusion of stddef.h without an actual use.
>    sc_prohibit_stddef_without_use:
>       h='stddef.h'                                                    \
>       re='\<($(_stddef_syms_re)) *\('                                 \
>         $(_sc_header_without_use)
>
> This tries to match "NULL (", NULL can exist in other situations:
>
>   gettimeofday (&tv, NULL);
>
> which will not be matched by the above, the same goes for ptrdiff_t,
> size_t and wchar_t (as variable type specifiers).

Thanks for the report.
This should fix it:

>From f7dbcea690572e75a85aea1263a222b11414bdd5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 25 Oct 2011 15:49:18 +0200
Subject: [PATCH] maint.mk: fix a bug in sc_prohibit_stddef_without_use

* top/maint.mk (sc_prohibit_stddef_without_use): Don't require / *\(/
after symbols like NULL, size_t, etc.
Reported by Alfred M. Szmidt.
---
 ChangeLog    |    5 +++++
 top/maint.mk |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 337cd03..546005e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-10-25  Jim Meyering  <address@hidden>

+       maint.mk: fix a bug in sc_prohibit_stddef_without_use
+       * top/maint.mk (sc_prohibit_stddef_without_use): Don't require / *\(/
+       after symbols like NULL, size_t, etc.
+       Reported by Alfred M. Szmidt.
+
        maint.mk: exempt ENODATA from a syntax-check rule
        * top/maint.mk (gl_extract_significant_defines_): Also exempt ENODATA
        from the sc_prohibit_always-defined_macros syntax-check rule.
diff --git a/top/maint.mk b/top/maint.mk
index be348dd..4c71187 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -618,7 +618,7 @@ _stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
 # Prohibit the inclusion of stddef.h without an actual use.
 sc_prohibit_stddef_without_use:
        @h='stddef.h'                                                   \
-       re='\<($(_stddef_syms_re)) *\('                                 \
+       re='\<($(_stddef_syms_re))\>'                                   \
          $(_sc_header_without_use)

 # Prohibit the inclusion of verify.h without an actual use.
--
1.7.7.419.g87009



reply via email to

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