Blame SOURCES/findutils-4.5.7-warnings.patch

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