Path: utzoo!mnetor!uunet!mcvax!eutrc3!wswietse From: wswietse@eutrc3.UUCP (Wietse Venema) Newsgroups: comp.unix.microport Subject: Re: YAMB: problems with yacc? Message-ID: <190@eutrc3.UUCP> Date: 22 Mar 88 22:23:20 GMT References: <437@splut.UUCP> <1107@ssc.UUCP> Organization: Tech. Univ. Eindhoven, Neth. Lines: 24 Keywords: won't do hoc1 right Summary: it's a compiler bug! In article <437@splut.UUCP>, jay@splut.UUCP (Jay Maynard) writes: > I tried entering the program hoc1, from the book _The Unix Programming > Environment_, and compiling it last night. It doesn't run: when fed an > expression like 2+2, instead of printing 4, it prints 2. It appears to > reproduce productions of the form: > expr: expr '+' expr { $$ = $1 + $3 }... > ... > Am I bashing my head against YAMB (yet another Microport bug)? > ... > Jay Maynard, EMT-P, K5ZC...>splut!< | GEnie: JAYMAYNARD CI$: 71036,1603 > ... Well, actually it's a bug in the C compiler. Take a look of the assembly language generated by the compiler. Seems the compiler generates incorrect 80287 opcodes. BTW we reported this problem a long time ago (6 months) in the days of version 2.2. What happened to that bug list? The problems should go away if you typedef the YACC stack as int. -- uucp: mcvax!eutrc3!wswietse | Eindhoven University of Technology bitnet: wswietse@heithe5 | Dept. of Mathematics and Computer Science surf: tuerc5::wswietse | Eindhoven, The Netherlands.