Eric Blake wrote: > Should we get rid of the > sanity checks that use #error when a macro is undefined, in order > to reduce the number of exemptions?
I agree, this would be useful for those source files that are always taken as an entire module from gnulib. I wouldn't do so for error.c and getopt.c, though: these two files are shared with many more packages, through manual copying. Also strtoimax.c is a bit complicated (because shared among two modules), therefore the check is non-trivial and welcome. Here are 2 proposed patch. Jim, Simon, OK? 2012-07-15 Bruno Haible <br...@clisp.org> getpass: Assume AC_CHECK_DECLS_ONCE invocation, like in getpass.m4. * lib/getpass.h: Assume HAVE_DECL_GETPASS is defined. * cfg.mk (exclude_file_name_regexp--sc_prohibit_defined_have_decl_tests): Remove exemption for getpass.h. Suggested by Eric Blake. --- cfg.mk.orig Sun Jul 15 16:09:17 2012 +++ cfg.mk Sun Jul 15 16:09:10 2012 @@ -79,4 +79,4 @@ ^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)$$ + ^lib/((error|getopt|strtoimax)\.c|(argp-namefrob|fpending)\.h)$$ --- lib/getpass.h.orig Sun Jul 15 16:09:17 2012 +++ lib/getpass.h Sun Jul 15 16:07:35 2012 @@ -21,7 +21,7 @@ /* Get getpass declaration, if available. */ # include <unistd.h> -# if defined HAVE_DECL_GETPASS && !HAVE_DECL_GETPASS +# if !HAVE_DECL_GETPASS /* Read a password of arbitrary length from /dev/tty or stdin. */ char *getpass (const char *prompt); 2012-07-15 Bruno Haible <br...@clisp.org> fpending: Assume AC_CHECK_DECLS_ONCE invocation, like in fpending.m4. * lib/fpending.h: Assume HAVE_DECL___FPENDING is defined. * cfg.mk (exclude_file_name_regexp--sc_prohibit_defined_have_decl_tests): Remove exemption for fpending.h. Suggested by Eric Blake. --- cfg.mk.orig Sun Jul 15 16:13:58 2012 +++ cfg.mk Sun Jul 15 16:13:56 2012 @@ -79,4 +79,4 @@ ^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)$$ + ^lib/((error|getopt|strtoimax)\.c|(argp-namefrob|getpass)\.h)$$ --- lib/fpending.h.orig Sun Jul 15 16:13:58 2012 +++ lib/fpending.h Sun Jul 15 16:13:20 2012 @@ -21,10 +21,6 @@ #include <stddef.h> #include <stdio.h> -#ifndef HAVE_DECL___FPENDING -"this configure-time declaration test was not run" -#endif - #if HAVE_DECL___FPENDING # if HAVE_STDIO_EXT_H # include <stdio_ext.h>