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
Exempt a few files that still get picked up in the wild rather
than as a full gnulib module with m4 files.
* top/maint.mk (sc_prohibit_defined_have_decl_tests): New rule.
* cfg.mk
(exclude_file_name_regexp--sc_prohibit_defined_have_decl_tests):
Exempt some false positives.
Based on a report by Karel Zak.
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-07-13 Eric Blake <eblake@redhat.com>
+ maint.mk: new syntax check for HAVE_DECL checks
+ * top/maint.mk (sc_prohibit_defined_have_decl_tests): New rule.
+ * cfg.mk
+ (exclude_file_name_regexp--sc_prohibit_defined_have_decl_tests):
+ Exempt some false positives.
+ Based on a report by Karel Zak.
+
argp: make HAVE_DECL usage consistent
* lib/argp-parse.c (__argp_parse): Check contents of HAVE_DECL
macros, not whether they are defined.
exclude_file_name_regexp--sc_avoid_if_before_free = \
^lib/($(if_before_free_basename_re_))\.c$$
+
+exclude_file_name_regexp--sc_prohibit_defined_have_decl_tests = \
+ ^lib/((error|getopt|strtoimax)\.c|(argp-namefrob|fpending|getpass)\.h)$$
' with the corresponding gnulib module, they are always true') \
$(_sc_search_regexp)
+sc_prohibit_defined_have_decl_tests:
+ prohibit='#[ ]*if(n?def|.*\<defined)\>[ (]+HAVE_DECL_' \
+ halt='$(ME): HAVE_DECL macros are always defined' \
+ $(_sc_search_regexp)
+
# ==================================================================
gl_other_headers_ ?= \
intprops.h \