Skip site navigation (1)Skip section navigation (2)
Date:      7 Aug 2000 16:22:52 -0000
From:      patrick@mindstep.com
To:        freefall-gnats@mindstep.com
Subject:   bin/20456: Ambiguous code construct in TCSH
Message-ID:  <20000807162252.88063.qmail@nitro.local.mindstep.com>

next in thread | raw e-mail | index | archive | help

>Number:         20456
>Category:       bin
>Synopsis:       Ambiguous code construct in TCSH
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 07 09:20:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Patrick Bihan-Faou
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
MindStep Corporation
>Environment:

FreeBSD 4.x Stable build from source tree as of August 5, 2000

>Description:

CSH has been replaced by TCSH. While building TCSH during make world,
gcc complains about an ambiguous if/if/else construct:

cc -O3 -pipe -march=i586 -I/home/patrick/mindbox/freebsd/kernel/freebsd-src/bin/csh/../../contrib/tcsh -I/home/patrick/mindbox/freebsd/kernel/freebsd-src/bin/csh -I. -D_PATH_TCSHELL='"/home/patrick/mindbox/freebsd/kernel/tmpobj/home/patrick/mindbox/freebsd/kernel/freebsd-src/i386/bin/csh"' -Wall -Wformat   -I/home/patrick/mindbox/freebsd/kernel/tmpobj/home/patrick/mindbox/freebsd/kernel/freebsd-src/i386/usr/include -c /home/patrick/mindbox/freebsd/kernel/freebsd-src/bin/csh/../../contrib/tcsh/sh.sem.c
/home/patrick/mindbox/freebsd/kernel/freebsd-src/bin/csh/../../contrib/tcsh/sh.sem.c: In function `execute':
/home/patrick/mindbox/freebsd/kernel/freebsd-src/bin/csh/../../contrib/tcsh/sh.sem.c:352: warning: suggest explicit braces to avoid ambiguous `else'


>How-To-Repeat:

cd /usr/src/bin/csh; make

>Fix:

The following patch for /usr/src/contrib/tcsh/sh.sem.c adds the necessary braces to fix the problem.


--- sh.sem.c.orig	Mon Aug  7 12:09:32 2000
+++ sh.sem.c	Mon Aug  7 12:21:20 2000
@@ -350,6 +350,7 @@
 	 */
 	    (bifunc && (t->t_dflg & F_PIPEIN) != 0 &&
 	     bifunc->bfunct == (bfunc_t)doeval))
+	{
 #ifdef VFORK
 	    if (t->t_dtyp == NODE_PAREN ||
 		t->t_dflg & (F_REPEAT | F_AMPERSAND) || bifunc)
@@ -586,6 +587,8 @@
 
 	    }
 #endif /* VFORK */
+	}
+
 	if (pid != 0) {
 	    /*
 	     * It would be better if we could wait for the whole job when we



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000807162252.88063.qmail>