Hi tech,

according to scan-build(1) there are a few "never read" values.

fritjof



Index: co.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/co.c,v
retrieving revision 1.118
diff -u -p -r1.118 co.c
--- co.c        2 Oct 2014 06:23:15 -0000       1.118
+++ co.c        6 Oct 2014 18:55:54 -0000
@@ -56,7 +56,6 @@ checkout_main(int argc, char **argv)
 
        flags = ret = 0;
        kflag = RCS_KWEXP_ERR;
-       rev = RCS_HEAD_REV;
        rev_str = NULL;
        author = date = state = NULL;
 
@@ -256,7 +255,7 @@ checkout_rev(RCSFILE *file, RCSNUM *frev
        time_t rcsdate, givendate;
        RCSNUM *rev;
 
-       rcsdate = givendate = -1;
+       givendate = -1;
        if (date != NULL && (givendate = date_parse(date)) == -1) {
                warnx("invalid date: %s", date);
                return -1;
Index: diff.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/diff.c,v
retrieving revision 1.34
diff -u -p -r1.34 diff.c
--- diff.c      16 May 2013 12:44:48 -0000      1.34
+++ diff.c      6 Oct 2014 19:03:31 -0000
@@ -1302,7 +1302,7 @@ dump_unified_vec(FILE *f1, FILE *f2, int
        if (context_vec_start > context_vec_ptr)
                return;
 
-       b = d = 0;              /* gcc */
+       d = 0; /* gcc */
        lowa = MAX(1, cvp->a - diff_context);
        upb = MIN(len[0], context_vec_ptr->b + diff_context);
        lowc = MAX(1, cvp->c - diff_context);
Index: merge.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/merge.c,v
retrieving revision 1.8
diff -u -p -r1.8 merge.c
--- merge.c     2 Oct 2014 06:23:15 -0000       1.8
+++ merge.c     6 Oct 2014 19:04:07 -0000
@@ -40,7 +40,6 @@ merge_main(int argc, char **argv)
        BUF *bp;
 
        flags = labels = 0;
-       status = D_ERROR;
 
        /*
         * Using getopt(3) and not rcs_getopt() because merge(1)
Index: rcs.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcs.c,v
retrieving revision 1.80
diff -u -p -r1.80 rcs.c
--- rcs.c       7 Jan 2014 14:08:16 -0000       1.80
+++ rcs.c       6 Oct 2014 19:05:56 -0000
@@ -214,7 +214,6 @@ rcs_write(RCSFILE *rfp)
        int fd;
 
        fn = NULL;
-       fd = -1;
 
        if (rfp->rf_flags & RCS_SYNCED)
                return;
Index: rcsmerge.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcsmerge.c,v
retrieving revision 1.53
diff -u -p -r1.53 rcsmerge.c
--- rcsmerge.c  2 Oct 2014 06:23:15 -0000       1.53
+++ rcsmerge.c  6 Oct 2014 19:07:52 -0000
@@ -44,7 +44,6 @@ rcsmerge_main(int argc, char **argv)
        BUF *bp;
 
        flags = 0;
-       kflag = RCS_KWEXP_ERR;
        status = D_ERROR;
        rev1 = rev2 = NULL;
        rev_str1 = rev_str2 = NULL;
Index: rcsparse.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcsparse.c,v
retrieving revision 1.9
diff -u -p -r1.9 rcsparse.c
--- rcsparse.c  3 Jun 2013 17:04:35 -0000       1.9
+++ rcsparse.c  6 Oct 2014 19:10:03 -0000
@@ -915,7 +915,6 @@ rcsparse_token(RCSFILE *rfp, int allowed
        } while (isspace(c));
 
        pdp->rp_msglineno = pdp->rp_lineno;
-       type = 0;
        switch (c) {
        case '@':
                ret = rcsparse_string(rfp, allowed);
@@ -1104,7 +1103,6 @@ rcsparse(RCSFILE *rfp, struct rcs_sectio
        int i, token;
 
        pdp = (struct rcs_pdata *)rfp->rf_pdata;
-       i = 0;
 
        token = 0;
        for (i = 0; sec[i].token != 0; i++) {
Index: rcsutil.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcsutil.c,v
retrieving revision 1.40
diff -u -p -r1.40 rcsutil.c
--- rcsutil.c   29 May 2014 16:39:42 -0000      1.40
+++ rcsutil.c   6 Oct 2014 19:11:42 -0000
@@ -157,8 +157,6 @@ rcs_choosefile(const char *filename, cha
        char *p, *ext, name[MAXPATHLEN], *next, *ptr, rcsdir[MAXPATHLEN],
            *suffixes, rcspath[MAXPATHLEN];
 
-       fd = -1;
-
        /*
         * If `filename' contains a directory, `rcspath' contains that
         * directory, including a trailing slash.  Otherwise `rcspath'
Index: rlog.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rlog.c,v
retrieving revision 1.68
diff -u -p -r1.68 rlog.c
--- rlog.c      2 Oct 2014 06:23:15 -0000       1.68
+++ rlog.c      6 Oct 2014 19:14:00 -0000
@@ -433,7 +433,7 @@ rlog_rev_print(struct rcs_delta *rdp)
        struct rcs_branch *rb;
        struct rcs_delta *nrdp;
 
-       i = found = 0;
+       found = 0;
        author = NULL;
 
        /* -l[lockers] */

Reply via email to