[comp.lang.prolog] CProlog for a HP 9000 running HP-UX

ag4@vax1.UUCP (Anne Louise Gockel) (09/28/87)

I am naively trying to compile CProlog 1.5 on the Hewlett-Packard HP 9000
which runs HP-UX.  HP-UX is a System V based Unix. The HP-UX C compiler chokes
on several constructions that the Mt. Xinu (BSD) C-compiler allows.

Can anyone tell me where I can find a CProlog that will compile on a System V
machine, or even better under HP-UX?  Can anyone tell me where I can find a 
more recent version of CProlog?



I am not sure why the BSD C compiler compiles the code that the HP-UX compiler
chokes on.  As far as I can see the code is incorrect.  Basically a variable
that is defined as 'pointer to a pointer' is dereferenced.  E.G.:


/* The original EMAS Prolog in IMP relies too much on pointers being
   just addresses, independently of the type pointed to, for me to be
   able to do anything about it. To help satisfy the compiler's view
   of typing, addresses are objects of type PTR, which are then cast
   into the appopriate types.
*/
typedef unsigned **PTR;
static  PTR f, d, b, k, k1, y, p, l, arg1;
 .......
	if (k->NextVar == NULL ||
	    (SC(k->NextVar,>=,pauxstk) && SC(k->NextVar,<,ptr))) {
	    k->VarValue += rglb;
	    if (k->NextVar) k->NextVar += rauxstk;
	    k += k->VarLen;
	}


In the above code fragment the compiler complains about dereferencing the
variable k.  ('Cannot select field of non-structure.' and 'Incompatible types
in cast.') SC is a macro that does a signed-comparison between the 1st and 3rd
arguements.

                                                   Thank you,
                                                   Anne Louise Gockel
                                                   Cornell Computer Services
(ag4@vax1.ccs.cornell.edu
 ag4@CORNELLC.bitnet)