From patrick@mindstep.com  Mon Aug  7 09:19:52 2000
Return-Path: <patrick@mindstep.com>
Received: from modemcable127.61-201-24.mtl.mc.videotron.net (modemcable136.200-201-24.mtl.mc.videotron.net [24.201.200.136])
	by hub.freebsd.org (Postfix) with SMTP id B4DAC37BB3B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  7 Aug 2000 09:19:46 -0700 (PDT)
	(envelope-from patrick@mindstep.com)
Received: (qmail 64635 invoked by alias); 7 Aug 2000 16:19:45 -0000
Received: (qmail 64631 invoked from network); 7 Aug 2000 16:19:44 -0000
Received: from nitro.local.mindstep.com (qmailr@192.168.10.2)
  by jacuzzi.local.mindstep.com with SMTP; 7 Aug 2000 16:19:44 -0000
Received: (qmail 88064 invoked by uid 0); 7 Aug 2000 16:22:52 -0000
Message-Id: <20000807162252.88063.qmail@nitro.local.mindstep.com>
Date: 7 Aug 2000 16:22:52 -0000
From: patrick@mindstep.com
Reply-To: patrick@mindstep.com
To: freefall-gnats@mindstep.com
Subject: Ambiguous code construct in TCSH
X-Send-Pr-Version: 3.2

>Number:         20456
>Category:       bin
>Synopsis:       Ambiguous code construct in TCSH
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 07 09:20:00 PDT 2000
>Closed-Date:    Tue Aug 8 02:09:52 PDT 2000
>Last-Modified:  Tue Aug 08 02:11:33 PDT 2000
>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:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Aug 8 01:39:11 PDT 2000 
Responsible-Changed-Why:  
This will probably need to be submitted back to the author 
before inclusion in the FreeBSD source tree, but thanks 
for the report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20456 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Tue Aug 8 02:09:52 PDT 2000 
State-Changed-Why:  
Tcsh is not FreeBSD developed code.  We(I) simply maintain the building  
mechanism to allow it being part of the FreeBSD base system. 
For generic code problems, please email Christos Zoulas <christos@zoulas.com>. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20456 
>Unformatted:
