Require that most .c files include <config.h>.

(sc_require_config_h): New rule.
(syntax-check-rules): Add it.
This commit is contained in:
Jim Meyering committed 2005-11-13 15:05:45 +00:00
1 parent 13e06b3243
commit 68943d27f8
1 file changed
+11
+11
View File
@@ -79,6 +79,7 @@ syntax-check-rules = \
sc_obsolete_symbols \
sc_prohibit_atoi_atof \
sc_prohibit_jm_in_m4 \
sc_require_config_h \
sc_root_tests \
sc_space_tab \
sc_sun_os_names \
@@ -163,6 +164,15 @@ sc_no_if_have_config_h:
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
1>&2; exit 1; } || :
# Nearly all .c files must include <config.h>.
sc_require_config_h:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep -L '^# *include <config\.h>' \
$$($(CVS_LIST) | grep '\.c$$' | grep -vEf .x-$@ ) \
| grep . && \
{ echo '$(ME): the above files do not include <config.h>' \
1>&2; exit 1; } || :
sc_obsolete_symbols:
@( $(CVS_LIST) ) > /dev/null 2>&1 || : && \
grep -E '\<(HAVE_FCNTL_H)\>' \
@@ -487,6 +497,7 @@ announcement: NEWS ChangeLog $(rel-files)
--prev=$(PREV_VERSION) \
--curr=$(VERSION) \
--release-archive-directory=$(release_archive_dir) \
--gpg-key-id=$(gpg_key_ID) \
--news=NEWS \
$(addprefix --url-dir=, $(url_dir_list)) \