[comp.sys.amiga.tech] Problem with Lattice Prototypes?

hamilton@intersil.uucp (08/05/90)

Hello all,

I'm having trouble trying to compile the AFM program included with the
LUCAS/FRANCES board documentation.  My grasp of C is tenuous to begin with, and 
I THINK I've found a problem with Lattice 5.05.  I seem to be having several
problems.  The first compile error I get is on this line:

                                       Highlight is here|
                                                        |  
    if ( TypeOfMem ( Base + sizeof(struct MemHeader) ) == 0L )
afm.c 138 Error 91: illegal void operand

I looked in the Lattice prototypes and they do indeed declare the TypeOfMem()
function as VOID.  But this doesn't make sense does it?  The autodocs and
common sense say it should return a long word indicating the type of memory
at that location.

So I went into my the uncompressed compiler_headers directory and changed the
prototype to long instead of void.  I then changed the include: assign to the
uncompressed headers and recompiled.  

I got a zillion NEW errors.  It appears that many of the uncompressed header
files are different than the compressed version.  To make sure I, lcompacted
the original exec.h prototype and put it into the compacted include: directory
and recompiled.  I still got new errors.  They went away when I substituted 
the original compressed exec.h file.

To make sure I hadn't screwed up sometime when I was upgrading, I went back to
my original 5.0 disks and patched them to 5.02, 5.04, and 5.05 again.  The
same problem was there.


To restate the problem, I get different (and many more) errors if I compile with
     Assign INCLUDE: dh0:lc/Compiler_Headers
than 
     Assign INCLUDE: dh0:lc/include
This shouldn't happen, right?

I believe the second error should go away once I fix the prototype problem:

    else if (DebugFlag)
afm.c 144 Error 49: else not associated with if


The third error:

    ExecBase->KickCheckSum = SumKickData ();
afm.c 317 Error 91: illegal void operand

seems to be a mistake on the programmer's part.  SumKickData() IS a void
function; it sets ExecBase->KickCheckSum itself and returns nothing.  I plan
to get around this by simply replacing the line with:

    SumKickData ();

I'd really appreciate it if anyone out there can tell me if I'm right or
wrong, and/or show me how to get around any of these problems.  Thanks.
-- 
Fred Hamilton                  Any views, comments, or ideas expressed here
Harris Semiconductor           are entirely my own.  Even good ones.
Santa Clara, CA