[alt.sources.d] Building the pd ksh under SunOS 4.1

brendan@cs.widener.edu (Brendan Kehoe) (12/15/90)

 Wow! Have I had a problem building THIS thing.
 After working out all of the little problems (and not so little
ones), I've come to this point:

 I've got everything so it'll compile, except the offsetof macro. I
even took the one that's in cnews's source and used *that* one, and it
died. It can't seem to deal with

	offsetof(structuretype, somevariable[withanargument])

it constantly croaks. If I explicitly put

	((size_t)&((structuretype *)NULL)->somevariable[withanargument])

it compiles fine, but the c_alias() function craps out (if I type
'alias', it does a SEGV). With a little digging I discovered that it's
trying to print out the value of an alias that doesn't exist; here's
the chunk of code:

		for (p = tsort(t); (ap = *p++) != NULL; )
			if (ap->type == CALIAS && (ap->flag&DEFINED))
				printf("%s='%s'\n", ap->name, ap->val.s);

 When it tries to print ap->name (which points off into never-never
land), it dies.
 My suspicion is that my hacking & inability to make offsetof work in
table.c and alloc.c may be the culprit. The other things were just
little changes of semantics (like having v*printf()'s defined twice),
etc. This was the only real operational change. It's only used twice
.. once in an alloc() call and again in a malloc() call. Sooo I'm
thinking it's not getting enough memory for the structure it's
attempting. Anybody have any ideas? How about Mr. Creator?

 Oh well, another dream shelved for a little while longer.

-- 
    Brendan Kehoe - Widener Sun Network Manager - brendan@cs.widener.edu
 Widener University in Chester, PA - "Yes Virginia the sky is blue, but
  only due to a strange atmospheric inversion that is directly attributable
  to stresses in the cross-continental neo-hegelian manifolds." "Hey, thanks."