[net.micro.amiga] YABoing problem?

phil@sivax.UUCP (Phil Hunt) (09/25/86)

Hello everybody.

   I grabbed the c program YABoing off the net and tried to compile it with
Lattice 'C' V3.03.

   I modified line 410 as told.  I recieved the warning 30's about pointer 
references and the 1 declared but not used variable warning as told but...

   I also recieved an ERROR 30: Pointer error on line 75.

   The Lattice 'C' manual says this is fatal if it happens on an initializer
expression, non-fatal elsewhere.

   Anyone know what happened???

   Phil Hunt
   ..calma!sivax!phil

dillon@CORY.BERKELEY.EDU (Matt Dillon) (09/26/86)

	I think he declares some functions to return VOID somewhere and
then tries to use the return value.  (I vaguely remember having to make 2
or 3 changes to get YABoing to work w/ my Lattice compiler)

					-Matt

adp@hp-sdd.UUCP (Tony Parkhurst) (09/26/86)

In article <343@sivax.UUCP> phil@sivax.UUCP (Phil Hunt) writes:
>   I grabbed the c program YABoing off the net and tried to compile it with
>Lattice 'C' V3.03.
 
>   I also recieved an ERROR 30: Pointer error on line 75.
 
>   Anyone know what happened???

It seems that Lattice doesn't like assigning contants to pointers.
The line looks like:

	struct Custom *cstm = 0x0fe2ba;   (or something)

The way I fixed it was:

	struct Custom *cstm = (struct Custom *) 0x0fe2ba; 
	       	              ^^^^^^^^^^^^^^^^^

Which just tells the compiler that the constant is of the correct pointer type.

Lattice compiled this just fine.  Hope this helps.
-- 
*******************************************************************************
*      Tony Parkhurst -- {hplabs|sdcsvax|ncr-sd|hpfcla|ihnp4}!hp-sdd!adp      *
*                        OR   hp-sdd!adp@nosc.arpa                            *
*******************************************************************************

ali@navajo.STANFORD.EDU (Ali Ozer) (09/27/86)

------------->8

I just got my hands on a Lattice compiler and compiled YaBoing with it.
And, yes, I get all these messages that I don't get with the Manx compiler!
Anyway, you can ignore all the warnings (I guess) but the initializer on line
71 gives a fatal error. Replacing

  struct Custom *cstm = 0xdff000;

on line 71 with 

  extern struct Custom custom;

and the two places where "cstm->" occurs with "custom." (including the DOT)
fixes the problem. (These occur on lines 201 and 308.) This second solution
seems like the better one, because you don't have this hardwired address
in your program. But, I could not get it to work with Manx (why, is it 
short/long data/code problems?). So I ended up sticking in the address in 
there...

After this you still get 3 warnings but they can be ignored. (The Lattice
version ends up being more than 20000 bytes long (as opposed to Manx's
4900+), I am wondering if I compiled wrong (or somehow brought in and actually
included libraries I was not supposed to). But it works!)

Ali

dillon@CORY.BERKELEY.EDU (Matt Dillon) (09/28/86)

>I just got my hands on a Lattice compiler and compiled YaBoing with it.
>And, yes, I get all these messages that I don't get with the Manx compiler!
>Anyway, you can ignore all the warnings (I guess) but the initializer on line
>71 gives a fatal error. Replacing
>
>  struct Custom *cstm = 0xdff000;
>
>on line 71 with 
>
>  extern struct Custom custom;

I just replaced it with:   struct Custom *cstm = (struct Custom *)0xdff000;

Even better, you don't cstm at all, you could

#define cstm ((struct Custom *)0xdff000)

And it should work fine.


>After this you still get 3 warnings but they can be ignored. (The Lattice
>version ends up being more than 20000 bytes long (as opposed to Manx's
>4900+), I am wondering if I compiled wrong (or somehow brought in and actually
>included libraries I was not supposed to). But it works!)
>
>Ali

	Yes, you actually Linked incorrectly.  Link with Astartup.obj (Since
YABoing doesn't seem to need the lattice library) rather than Lstartup.obj.
The code size is about 6420 bytes.

			-Matt