Clang also warned about this:

    ANALYZE: eval.c evalpipe
    eval.c:575:10: warning: Assigned value is garbage or undefined
                    prevfd = pip[0];
                           ^ ~~~~~~

Here's a fix:

2011-05-25  Jim Meyering  <meyer...@redhat.com>

        avoid more undefined handler
        * src/eval.c (evalpipe): Ensure that pip[0] is defined before used.


>From dca635b44d289eeb6b7d0fb6a60db37fb61bc863 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@redhat.com>
Date: Wed, 25 May 2011 14:35:24 +0200
Subject: [PATCH] avoid more undefined handler

* src/eval.c (evalpipe): Ensure that pip[0] is defined before used.

Signed-off-by: Jim Meyering <meyer...@redhat.com>
---
 src/eval.c |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index 911fb2c..a93e602 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -547,6 +547,7 @@ evalpipe(union node *n, int flags)
        prevfd = -1;
        for (lp = n->npipe.cmdlist ; lp ; lp = lp->next) {
                prehash(lp->n);
+               pip[0] = -1;
                pip[1] = -1;
                if (lp->next) {
                        if (pipe(pip) < 0) {
--
1.7.5.2.609.g6dbbf
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to