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 ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature