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_ ? 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_. > + halt='$(ME): HAVE_DECL macros are always defined' \ > + $(_sc_search_regexp)