From: Pádraig Brady Date: Sat, 18 Dec 2010 23:06:10 +0000 (+0000) Subject: maint: suppress some clang scan-build warnings X-Git-Tag: v8.10~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5d283dbc9ae8d727470975bc8fdd3371468cbdf;p=thirdparty%2Fcoreutils.git maint: suppress some clang scan-build warnings * src/pr.c (char_to_clump): Remove a dead store. * src/remove.c (fts_skip_tree): Likewise. * src/sort.c (key_warnings): Likewise. (sort): Suppress an uninitialized pointer warning. --- diff --git a/src/pr.c b/src/pr.c index 4748604c91..7e6b13cc8a 100644 --- a/src/pr.c +++ b/src/pr.c @@ -2695,7 +2695,7 @@ char_to_clump (char c) width = 2; chars = 2; *s++ = '^'; - *s++ = c ^ 0100; + *s = c ^ 0100; } else { diff --git a/src/remove.c b/src/remove.c index a473dab956..f7b00c62e3 100644 --- a/src/remove.c +++ b/src/remove.c @@ -25,6 +25,7 @@ #include "error.h" #include "euidaccess-stat.h" #include "file-type.h" +#include "ignore-value.h" #include "quote.h" #include "remove.h" #include "root-dev-ino.h" @@ -402,7 +403,7 @@ fts_skip_tree (FTS *fts, FTSENT *ent) { fts_set (fts, ent, FTS_SKIP); /* Ensure that we do not process ENT a second time. */ - ent = fts_read (fts); + ignore_value (fts_read (fts)); } /* Upon unlink failure, or when the user declines to remove ENT, mark diff --git a/src/sort.c b/src/sort.c index cbc0c38565..06b0d95a13 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2341,10 +2341,10 @@ key_warnings (struct keyfield const *gkey, bool gkey_only) pn = stpcpy (stpcpy (pn, "-k "), umaxtostr (sword + 1, tmp)); if (key->eword != SIZE_MAX) { - po = stpcpy (stpcpy (po, " -"), umaxtostr (eword + 1, tmp)); - pn = stpcpy (stpcpy (pn, ","), - umaxtostr (eword + 1 - + (key->echar == SIZE_MAX), tmp)); + stpcpy (stpcpy (po, " -"), umaxtostr (eword + 1, tmp)); + stpcpy (stpcpy (pn, ","), + umaxtostr (eword + 1 + + (key->echar == SIZE_MAX), tmp)); } error (0, 0, _("obsolescent key `%s' used; consider `%s' instead"), obuf, nbuf); @@ -3770,6 +3770,7 @@ sort (char *const *files, size_t nfiles, char const *output_file, size_t nthreads) { struct buffer buf; + IF_LINT (buf.buf = NULL); size_t ntemps = 0; bool output_file_created = false;