diff --git a/ChangeLog b/ChangeLog index dd8e3415..bfa2c2a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2011-06-02 James Youngman + + Remove unnecessary header checks and include guards. + * configure.ac (AC_CHECK_HEADERS): Remove checks for header files + that gnulib either assumes are always present, or provides + itself. These include errno.h fcntl.h inttypes.h limits.h + locale.h stddef.h stdint.h stdlib.h string.h sys/types.h + unistd.h. + * lib/buildcmd.c: Remove include guard for limits.h. + * find/fstype.c: Remove include guard for sys/types.h. + * lib/savedirinfo.c: Likewise. + * find/find.c: Remove include guard for locale.h. + * find/ftsfind.c: Likewise. + 2011-06-01 James Youngman Better error handling for the result of set_fstype_devno. diff --git a/configure.ac b/configure.ac index 9aff8c83..c46ffc2d 100644 --- a/configure.ac +++ b/configure.ac @@ -119,15 +119,13 @@ AC_SUBST([FINDLIBS]) dnl Checks for header files. AC_HEADER_STDC -dnl Assume unistd.h is present - coreutils does too. -AC_CHECK_HEADERS(fcntl.h string.h limits.h errno.h stdlib.h stddef.h) -AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h) AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h) dnl find.c needs sys/utsname.h because it calls uname(2). AC_CHECK_HEADERS(sys/utsname.h) dnl fdleak.c needs sys/resource.h because it calls getrlimit(2). AC_CHECK_HEADERS(sys/resource.h) AC_HEADER_MAJOR +dnl TODO: it's possible gnulib eliminates the need for AC_HEADER_DIRENT. AC_HEADER_DIRENT AC_HEADER_STAT AC_HEADER_SYS_WAIT diff --git a/find/find.c b/find/find.c index 98d5a376..67da83a3 100644 --- a/find/find.c +++ b/find/find.c @@ -37,6 +37,7 @@ #include #include +#include #include "fcntl--.h" #include "xalloc.h" @@ -53,10 +54,6 @@ #include "progname.h" #include "save-cwd.h" -#ifdef HAVE_LOCALE_H -#include -#endif - #if ENABLE_NLS # include # define _(Text) gettext (Text) diff --git a/find/fstype.c b/find/fstype.c index fc8c09ca..cac2d28e 100644 --- a/find/fstype.c +++ b/find/fstype.c @@ -27,9 +27,7 @@ #include #include -#ifdef HAVE_SYS_TYPES_H #include -#endif #include /* The presence of unistd.h is assumed by gnulib these days, so we diff --git a/find/ftsfind.c b/find/ftsfind.c index 9fdb8ef7..97fb2e4f 100644 --- a/find/ftsfind.c +++ b/find/ftsfind.c @@ -38,10 +38,10 @@ #include #include +#include #include #include - #include #include "progname.h" @@ -56,10 +56,6 @@ #include "fdleak.h" #include "unused-result.h" -#ifdef HAVE_LOCALE_H -#include -#endif - #if ENABLE_NLS # include # define _(Text) gettext (Text) diff --git a/lib/buildcmd.c b/lib/buildcmd.c index d595e6fd..0bc607cc 100644 --- a/lib/buildcmd.c +++ b/lib/buildcmd.c @@ -23,6 +23,8 @@ #include #include #include +#include + #if ENABLE_NLS # include @@ -43,10 +45,6 @@ #include #endif -#ifdef HAVE_LIMITS_H -#include -#endif - /* The presence of unistd.h is assumed by gnulib these days, so we * might as well assume it too. */ diff --git a/lib/savedirinfo.c b/lib/savedirinfo.c index d9b6000b..f712cdba 100644 --- a/lib/savedirinfo.c +++ b/lib/savedirinfo.c @@ -22,16 +22,8 @@ #include #include - -#if HAVE_SYS_TYPES_H # include -#endif - -/* The presence of unistd.h is assumed by gnulib these days, so we - * might as well assume it too. - */ #include - #include #if HAVE_DIRENT_H