[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint.mk: new syntax check for HAVE_DECL checks
From: |
Eric Blake |
Subject: |
Re: [PATCH] maint.mk: new syntax check for HAVE_DECL checks |
Date: |
Fri, 13 Jul 2012 14:20:44 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
On 07/13/2012 02:15 PM, Jim Meyering wrote:
> Eric Blake wrote:
>> Based on Karel's report, we might as well enforce a syntax check
>> to help avoid future problems.
>> https://lists.gnu.org/archive/html/coreutils/2012-06/msg00037.html
>>
>> * top/maint.mk (sc_prohibit_undefined_have_decl_tests): New rule.
>> * cfg.mk
>> (exclude_file_name_regexp--sc_prohibit_undefined_have_decl_tests):
>> Exempt some false positives.
>> Based on a report by Karel Zak.
>> ---
>>
>> Thoughts on whether this is useful? Should we get rid of the
>> sanity checks that use #error when a macro is undefined, in order
>> to reduce the number of exemptions?
>
> It's definitely worthwhile, considering the age of those bugs.
> Thanks!
>
> ...
>> +sc_prohibit_undefined_have_decl_tests:
>> + prohibit='#[ ]*if(n?def|.*defined)[ ]*\)?HAVE_DECL_' \
>
> Did you intend to allow an optional ")" just before HAVE_DECL_ ?
Aargh. I intended to allow an optional "(" (since not everyone enables
sc_useless_cpp_parens), but typed the wrong character.
> It might avoid a false positive or two to tighten up, adding \< and \> word
> delimiters after "def", on both sides of "defined" and before HAVE_DECL_.
As in:
prohibit='#[ ]*if(n?def|.*\<defined)\>[ ]+\(?HAVE_DECL_'
I'll go ahead and push once I test that tweak.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature