[comp.unix.questions] compiler error: schain botch

field@pitt.UUCP (Gus) (09/28/89)

I am trying to bring bash up on our VAX 11/780 (running 4.3 BSD),
and I get the following from cc:

	"execute_cmd.c", line 431: compiler error: schain botch

Anyone know what might be the cause of this.  Line 431 is a closing
parenthesis to a function.  The same source came up fine under
Sun OS 4.0.

Thanks
Brian
field@cs.pitt.edu

chris@mimsy.UUCP (Chris Torek) (10/01/89)

This is an old bug.  Here is the recommended fix.

(Incidentally, this bug usually only surfaces when a function contains a
number of `goto' statements.  Fuel for comp.lang.c.noise.about.goto :-) )

------- pftn.c -------
***************
*** 1922,1926 ****
  	p = clist;
  	while( p ){
! 		register struct symtab *r, *next;
  
  		q = p;
--- 1926,1930 ----
  	p = clist;
  	while( p ){
! 		register struct symtab *next, **t, *r;
  
  		q = p;
***************
*** 1930,1933 ****
--- 1934,1945 ----
  			if( q == p || q->stype == TNULL )break;
  			if( (r = relook(q)) != q ) {
+ 				/* move q in schain list */
+ 				t = &schain[q->slevel];
+ 				while( *t && *t != q )
+ 					t = &(*t)->snext;
+ 				if( *t )
+ 					*t = r;
+ 				else
+ 					cerror("schain botch 2");
  				*r = *q;
  				q->stype = TNULL;
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris