Bug 20456

Summary: Ambiguous code construct in TCSH
Product: Base System Reporter: patrick <patrick>
Component: binAssignee: David E. O'Brien <obrien>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description patrick 2000-08-07 17:20:00 UTC
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'

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

How-To-Repeat: 
cd /usr/src/bin/csh; make
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-08 09:39:11 UTC
Responsible Changed
From-To: freebsd-bugs->obrien

This will probably need to be submitted back to the author 
before inclusion in the FreeBSD source tree, but thanks 
for the report.
Comment 2 David E. O'Brien freebsd_committer freebsd_triage 2000-08-08 10:09:52 UTC
State Changed
From-To: open->closed

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>.