silence GCC warnings

This commit is contained in:
Kamil Dudka 2013-09-23 15:07:49 +02:00
parent 1c07ba6f13
commit 0fb0b5c269
3 changed files with 84 additions and 51 deletions

View File

@ -0,0 +1,79 @@
From 690d4bd9f29a805999a3ce4651dac9585ccc9917 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:57 +0200
Subject: [PATCH 1/3] findutils-4.5.7-warnings.patch
---
xargs/xargs.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 5e373f2..c0a8676 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1242,7 +1242,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
* utility if we run it, for POSIX compliance on the
* handling of exit values.
*/
- write (fd[1], &errno, sizeof (int));
+ int sink = write (fd[1], &errno, sizeof (int));
+ (void) sink;
}
close (fd[1]);
--
1.7.1
From c5654b9ca5f50daa1ca406ebd7b4546f24d00db6 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 23 Sep 2013 15:04:03 +0200
Subject: [PATCH 2/3] parser: silence a [-Wmaybe-uninitialized] GCC warning
... caused by a missing model of error()
---
find/parser.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/find/parser.c b/find/parser.c
index 89d8bcf..8c399d7 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -2776,7 +2776,7 @@ insert_type (char **argv, int *arg_ptr,
const struct parser_table *entry,
PRED_FUNC which_pred)
{
- mode_t type_cell;
+ mode_t type_cell /* to silence GCC warning */ = 0;
struct predicate *our_pred;
float rate = 0.5;
const char *typeletter;
--
1.7.1
From 19ee32ab3f001d12859b6e34ddbbaf64c1500c3d Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 23 Sep 2013 15:05:58 +0200
Subject: [PATCH 3/3] xargs: use a more appropriate printf conversion for size_t
---
xargs/xargs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/xargs/xargs.c b/xargs/xargs.c
index c0a8676..b1f5782 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1329,7 +1329,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
default:
{
error (EXIT_FAILURE, errno,
- _("read returned unexpected value %d; "
+ _("read returned unexpected value %lu; "
"this is probably a bug, please report it"), r);
}
} /* switch on bytes read */
--
1.7.1

View File

@ -1,49 +0,0 @@
From 1b7065f25457fea9f9ee7100437b12815b92a38c Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:57 +0200
Subject: [PATCH 4/4] findutils-4.5.7-warnings.patch
---
find/exec.c | 2 +-
xargs/xargs.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/find/exec.c b/find/exec.c
index aa69fe3..f731d82 100644
--- a/find/exec.c
+++ b/find/exec.c
@@ -326,7 +326,7 @@ launch (struct buildcmd_control *ctl, void *usercontext, int argc, char **argv)
}
}
- if (bc_args_exceed_testing_limit (argv))
+ if (bc_args_exceed_testing_limit ((const char **) argv))
errno = E2BIG;
else
execvp (argv[0], argv);
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 3cc1832..35f6822 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1224,7 +1224,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
prep_child_for_exec ();
- if (bc_args_exceed_testing_limit (argv))
+ if (bc_args_exceed_testing_limit ((const char **) argv))
errno = E2BIG;
else
execvp (argv[0], argv);
@@ -1242,7 +1242,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
* utility if we run it, for POSIX compliance on the
* handling of exit values.
*/
- write (fd[1], &errno, sizeof (int));
+ int sink = write (fd[1], &errno, sizeof (int));
+ (void) sink;
}
close (fd[1]);
--
1.7.4.4

View File

@ -1,7 +1,7 @@
Summary: The GNU versions of find utilities (find and xargs)
Name: findutils
Version: 4.5.12
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 1
License: GPLv3+
Group: Applications/File
@ -16,7 +16,7 @@ Patch1: findutils-4.4.0-no-locate.patch
Patch3: findutils-4.4.2-xautofs.patch
# eliminate compile-time warnings
Patch4: findutils-4.5.7-warnings.patch
Patch4: findutils-4.5.12-warnings.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
@ -94,6 +94,9 @@ fi
%{_infodir}/find-maint.info.gz
%changelog
* Mon Sep 23 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.12-2
- silence GCC warnings
* Mon Sep 23 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.12-1
- new upstream release