4a59de
From 1b7065f25457fea9f9ee7100437b12815b92a38c Mon Sep 17 00:00:00 2001
4a59de
From: Kamil Dudka <kdudka@redhat.com>
4a59de
Date: Wed, 11 May 2011 16:46:57 +0200
4a59de
Subject: [PATCH 4/4] findutils-4.5.7-warnings.patch
4a59de
4a59de
---
4a59de
 find/Makefile.am  |    2 +-
4a59de
 find/defs.h       |    2 +-
4a59de
 find/exec.c       |    2 +-
4a59de
 find/find.c       |   14 +-------------
4a59de
 find/pred.c       |    2 +-
4a59de
 lib/Makefile.am   |    2 +-
4a59de
 xargs/Makefile.am |    2 +-
4a59de
 xargs/xargs.c     |    5 +++--
4a59de
 8 files changed, 10 insertions(+), 21 deletions(-)
4a59de
4a59de
diff --git a/find/Makefile.am b/find/Makefile.am
4a59de
index 0795b87..f1068bf 100644
4a59de
--- a/find/Makefile.am
4a59de
+++ b/find/Makefile.am
4a59de
@@ -36,7 +36,7 @@ endif
4a59de
 # We don't just include man_MANS in EXTRA_DIST because while the value of
4a59de
 # man_MANS is not always the same, we want to distribute all of those files.
4a59de
 EXTRA_DIST = defs.h sharefile.h print.h find.1 ftsfind.1 oldfind.1
4a59de
-INCLUDES = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
4a59de
+AM_CPPFLAGS = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
4a59de
 LDADD = ./libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_CLOSE) $(MODF_LIBM) $(FINDLIBS) $(GETHOSTNAME_LIB) $(LIB_EACCESS)
4a59de
 # gnulib advises we link against <first> because we use <second>:
4a59de
 # $(GETHOSTNAME_LIB)            uname
4a59de
diff --git a/find/defs.h b/find/defs.h
4a59de
index 366edab..f25b700 100644
4a59de
--- a/find/defs.h
4a59de
+++ b/find/defs.h
4a59de
@@ -258,7 +258,7 @@ struct predicate
4a59de
 
4a59de
   /* Only used for debugging, but defined unconditionally so individual
4a59de
      modules can be compiled with -DDEBUG.  */
4a59de
-  char *p_name;
4a59de
+  const char *p_name;
4a59de
 
4a59de
   /* The type of this node.  There are two kinds.  The first is real
4a59de
      predicates ("primaries") such as -perm, -print, or -exec.  The
4a59de
diff --git a/find/exec.c b/find/exec.c
4a59de
index aa69fe3..f731d82 100644
4a59de
--- a/find/exec.c
4a59de
+++ b/find/exec.c
4a59de
@@ -324,7 +324,7 @@ launch (struct buildcmd_control *ctl, void *usercontext, int argc, char **argv)
4a59de
 	    }
4a59de
 	}
4a59de
 
4a59de
-      if (bc_args_exceed_testing_limit (argv))
4a59de
+      if (bc_args_exceed_testing_limit ((const char **) argv))
4a59de
 	errno = E2BIG;
4a59de
       else
4a59de
 	execvp (argv[0], argv);
4a59de
diff --git a/find/find.c b/find/find.c
4a59de
index 5d287b5..00a2a6c 100644
4a59de
--- a/find/find.c
4a59de
+++ b/find/find.c
4a59de
@@ -528,6 +528,7 @@ wd_sanity_check (const char *thing_to_stat,
4a59de
 #ifdef STAT_MOUNTPOINTS
4a59de
 	  isfatal = dirchange_is_fatal (specific_what,isfatal,silent,newinfo);
4a59de
 #else
4a59de
+      (void) silent;
4a59de
 	  isfatal = RETRY_IF_SANITY_CHECK_FAILS;
4a59de
 #endif
4a59de
 	}
4a59de
@@ -1302,7 +1303,6 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp,
4a59de
 {
4a59de
   int subdirs_left;		/* Number of unexamined subdirs in PATHNAME. */
4a59de
   bool subdirs_unreliable;	/* if true, cannot use dir link count as subdir limif (if false, it may STILL be unreliable) */
4a59de
-  unsigned int idx;		/* Which entry are we on? */
4a59de
   struct stat stat_buf;
4a59de
   size_t dircount = 0u;
4a59de
   DIR *dirp;
4a59de
@@ -1519,7 +1519,6 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp,
4a59de
       if (strcmp (name, "."))
4a59de
 	{
4a59de
 	  enum SafeChdirStatus status;
4a59de
-	  struct dir_id did;
4a59de
 
4a59de
 	  /* We could go back and do the next command-line arg
4a59de
 	     instead, maybe using longjmp.  */
4a59de
@@ -1555,17 +1554,6 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp,
4a59de
 		     "%s", safely_quote_err_filename (0, pathname));
4a59de
 	      return;
4a59de
 	    }
4a59de
-
4a59de
-	  if (dir_curr > 0)
4a59de
-	    {
4a59de
-	      did.dev = dir_ids[dir_curr-1].dev;
4a59de
-	      did.ino = dir_ids[dir_curr-1].ino;
4a59de
-	    }
4a59de
-	  else
4a59de
-	    {
4a59de
-	      did.dev = starting_stat_buf.st_dev;
4a59de
-	      did.ino = starting_stat_buf.st_ino;
4a59de
-	    }
4a59de
 	}
4a59de
 
4a59de
       free (cur_path);
4a59de
diff --git a/find/pred.c b/find/pred.c
4a59de
index 88dacd9..e9c9a49 100644
4a59de
--- a/find/pred.c
4a59de
+++ b/find/pred.c
4a59de
@@ -1216,7 +1216,7 @@ pred_context (const char *pathname, struct stat *stat_buf,
4a59de
    Return BUF. */
4a59de
 
4a59de
 static char *
4a59de
-blank_rtrim (char *str, char *buf)
4a59de
+blank_rtrim (const char *str, char *buf)
4a59de
 {
4a59de
   int i;
4a59de
 
4a59de
diff --git a/lib/Makefile.am b/lib/Makefile.am
4a59de
index bbb4dc2..eba43d2 100644
4a59de
--- a/lib/Makefile.am
4a59de
+++ b/lib/Makefile.am
4a59de
@@ -28,7 +28,7 @@ DISTCLEANFILES =
4a59de
 MAINTAINERCLEANFILES =
4a59de
 
4a59de
 
4a59de
-INCLUDES = -I../gl/lib -I$(top_srcdir)/gl/lib
4a59de
+AM_CPPFLAGS = -I../gl/lib -I$(top_srcdir)/gl/lib
4a59de
 LDADD = ../gl/lib/libgnulib.a $(LIBINTL)
4a59de
 
4a59de
 libfind_a_SOURCES += printquoted.h listfile.h \
4a59de
diff --git a/xargs/Makefile.am b/xargs/Makefile.am
4a59de
index d34f87a..1cfe3e4 100644
4a59de
--- a/xargs/Makefile.am
4a59de
+++ b/xargs/Makefile.am
4a59de
@@ -3,7 +3,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
4a59de
 localedir = $(datadir)/locale
4a59de
 bin_PROGRAMS = xargs
4a59de
 man_MANS = xargs.1
4a59de
-INCLUDES = -I.. -I../gl/lib -I$(top_srcdir)/gl/lib -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
4a59de
+AM_CPPFLAGS = -I.. -I../gl/lib -I$(top_srcdir)/gl/lib -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
4a59de
 LDADD = ../lib/libfind.a ../gl/lib/libgnulib.a $(LIB_CLOSE) $(LIBINTL)
4a59de
 EXTRA_DIST = $(man_MANS)
4a59de
 SUBDIRS = . testsuite
4a59de
diff --git a/xargs/xargs.c b/xargs/xargs.c
4a59de
index 3cc1832..35f6822 100644
4a59de
--- a/xargs/xargs.c
4a59de
+++ b/xargs/xargs.c
4a59de
@@ -1208,7 +1208,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
4a59de
 
4a59de
 	    prep_child_for_exec ();
4a59de
 
4a59de
-	    if (bc_args_exceed_testing_limit (argv))
4a59de
+	    if (bc_args_exceed_testing_limit ((const char **) argv))
4a59de
 	      errno = E2BIG;
4a59de
 	    else
4a59de
 	      execvp (argv[0], argv);
4a59de
@@ -1226,7 +1226,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
4a59de
 		 * utility if we run it, for POSIX compliance on the
4a59de
 		 * handling of exit values.
4a59de
 		 */
4a59de
-		write (fd[1], &errno, sizeof (int));
4a59de
+		int sink = write (fd[1], &errno, sizeof (int));
4a59de
+		(void) sink;
4a59de
 	      }
4a59de
 
4a59de
 	    close (fd[1]);
4a59de
-- 
4a59de
1.7.4.4
4a59de