🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1749

Problems with hoc in Kernighan&Pike

#1749
From: T_Rex
Date: Tue, 25 Sep 1990 15:10
35 lines
1680 bytes
Hello,
	I'm attempting to get the hoc ( high order calculator ) example in
Kernighan and Pike's The_Unix_Programming_Environment up and running. I've
run into a problem in stage six. When I attempt to run the fib example ( every-
thing compiles and links fine ) I get a bus error and core dump. Under dbx, I
find the following problem:

hoc>dbx hoc6
Reading symbolic information...
Read 1358 symbols
(dbx) run fib -
Running: hoc6 fib - 
fib(10)
signal BUS (alignment error) in execute at line 417 in file "code.c"
  417                   (*(*pc++))();
(dbx) quit

lint tells me that there is possibly an error in pointer alignment in the
line
	yyval.sym = (Symbol *)emalloc(strlen(sbuf)+1)
in hoc.y

	We've compiled and tried to run this code on a Sun4, Sun3, and a
microVax, on the chance that this is a portability problem. No such luck;
we get the exact same problem in all three cases. All the other examples
in the text run ok.

	Has anyone dealt with this problem before, or have any suggestions?
Please reply by e-mail; I'll forward the contents of responses to anyone who
is interested, or summarize on the net if there is enough interest.

Thanks in advance,

Pete Wood 		e-mail wood@maccs.dcss.mcmaster.ca
Technical Details
Message-ID: <26FF737F.7303@maccs.dcss.mcmaster.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!maccs!maccs.dcss.mcmaster.ca!wood

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!maccs!maccs.dcss.mcmaster.ca!wood
From: wood@maccs.dcss.mcmaster.ca (T_Rex)
Newsgroups: comp.std.c
Subject: Problems with hoc in Kernighan&Pike
Message-ID: <26FF737F.7303@maccs.dcss.mcmaster.ca>
Date: 25 Sep 90 15:10:54 GMT
Sender: wood@maccs.dcss.mcmaster.ca (T_Rex)
Distribution: na
Organization: McMaster University, Hamilton, Ontario, Canada
Lines: 35