danoc@bonnie.UUCP (Dan O'Connell) (06/29/84)
There are a couple of small differences between the posted version of hoc6's hoc.y and the K&P version that makes it core dump when func's or proc's are read in. Edit hoc.y and replace "getchar()" with "getc(fin)". If you are on a USG system, replace "index(" with "strchr(". With these changes the functions "fib" and "fac" (P 274) and "ack" (P 284) in K&P work fine. Here is the output from "diff hoc.y hoc.y.orig": 133c133 < while ((c=getc(fin)) == ' ' || c == '\t') --- > while ((c=getchar()) == ' ' || c == '\t') 153c153 < } while ((c=getc(fin)) != EOF && isalnum(c)); --- > } while ((c=getchar()) != EOF && isalnum(c)); 201c201 < char *strchr(); --- > char *index(); /* `strchr()' in some systems */ 206,207c206,207 < if (islower(c) && strchr(transtab, c)) < return strchr(transtab, c)[1]; --- > if (islower(c) && index(transtab, c)) > return index(transtab, c)[1]; ### Dan O'Connell ATT&T @ AT&T Bell Laboratories Whippany, NJ floyd!danoc