[net.micro.amiga] AmigaTerm & Lattice_ C

hull@hao.UUCP (Howard Hull) (12/25/85)

After typing all 1103 lines (32859 bytes) of the AmigaTerm.c terminal prog.
I launched into compilation with v1.0 Lattice C (Yes, I know; I am one of
the suckers that went for it before anyone knew...) and now that I am done,
I would like to relate a few of the gory details.  I am writing this note
from my Amiga using the AmigaTerm program, so Michael Mounier and George
Jones must have done something right.  Thanks a million, guys!  I suspect,
however, that Michael either didn't use Lattice C, or his top level dir
looks different than the vanilla version I am using.  Nonetheless, I can
attest to the fact that the net.micro.amiga version distributed by George
is essentially bug free at the conversational level, anyway.  But I digress-
The first problem I ran into was just the matter of re-packaging the C1.0
Lattice disk.  I had faithfully attempted to follow their instructions with
respect to the "Install-C" script; this failed, claiming that it could not
find "C1.0", (I had copied the master and re-named the copy the same as the
master using the workbench pull-down menus, then re-booted with the new
disk in place).  It should have been able to find it, so I probably made a
typo.  Nonetheless, I then resorted to reading the script, which by the way
is named "install-C", not "Install-C".  I then did the same thing manually,
and that seemed to work.  I went on to try to compile the AmigaTerm.c file
and got several pages of compiler error messages, clearly indicative that
the compiler could not find any libraries.  So I began mucking about 
looking for them on my workbench disk (optimist that I am), and could not
find them any more than the compiler could.  I then realized that the libs
were half the C1.0 disk in size, and were still on IT.  So I initialized a
blank disk under the name "C_Programs" and executed the commands
	cd "C_Programs:"
	makedir lib
	makedir include
and then put the C1.0 disk back in the df1: drive and executed
	cd "C1.0"
	copy "lib/" to "C_Programs:lib/" OPT ALL
	(sound of shuffing disks, flashing wb swap requesters, etc.)
	copy "include/" to "C_Programs:include/" OPT ALL
and
	copy "AmigaTerm.c" to "C_Programs:AmigaTerm.c"
	(sound of more shuffling and swaps)
I then executed
	cd "C_Programs:"
and tried LC1 again.  This time I only got two pages of complaints.
Eleven complaints were associated with typing errors I had made in entering
the source.  Six were associated with the compiler's inability to find the
include files "stdio.h and ctype.h".  There were, additionally, several
warnings which I will discuss subsequently.  In order to get the compiler
to locate the two missing i/o libraries, I had decided to modify the source
file:  Instead of
	#include <stdio.h>
	#include <ctype.h>
I used
	#include <lattice/stdio.h>
	#include <lattice/ctype.h>
and went back for another shot at LC1.  This time, voila, no errors.
However, the warnings were still there (and remain yet).  They were:
	 340 Warning 94: uninitialized auto variable "trans"
	 359 Warning 94: uninitialized auto variable "tranr"
	 646 Warning 85: function return value mismatch
	 688 Warning 94: uninitialized auto variable "i"
	 833 Warning 94: uninitialized auto variable "i"
	1101 Warning 85: function return value mismatch
The uninitialized variables are associated with function calls, and since
these variables are not used before the called function sets them, I figure
they're ok.  The function return value mismatch is called because the
function "return(c)" wants to return type char, and lattice rigidly wants
to see all returns handed back type int.  I don't know what this will do,
or when it will decide to do it to me.  So. Press on.

A new invocation of LC1 from the dir "C_Programs:" actually made a quad
file, "AmigaTerm.q" for me.  It took almost 15 minutes to do it, among much
snorting and grunting.  The command line required to do this was:
	LC1 -iinclude/ AmigaTerm
note that the source file was named "AmigaTerm", and they don't want the
".c" extension to appear in the name given in the command line.
The second pass through the compiler took about 12 minutes, and produced no
new complaints.  The successful command line was:
	LC2 AmigaTerm
and
A check of the dir "C_Programs" revealed that the file "AmigaTerm.q" was
now gone, and a new file, "AmigaTerm.o" was there in its stead.  What this
easily overlooked fact should reveal to you is that if you wish not to
lose *n 15 minute hunks of your life, you should copy the ".q" file to a

blank disk before the compiler metamorphosizes it.  The compiler says:
	Module size P=00001B4C D=00000461 U=00001246
I think.
I initially tried the primordial version of the linker call, figuring that
Michael was likely an early-on veteran of Amiga linking, and had used CB's
startup libs.  Wrongo.  I got lots of missing _multch links.  The command
line that worked was the one that uses Lattice's stuff (perplexing, isn't
it).  To wit:

Link FROM /lib/Lstartup.obj+AmigaTerm.o LIBRARY /lib/lc.lib+/lib/amiga.lib TO Terminal

typed as one line.  Note that NOW they want a ".o" extension in the command
line.  My comment: *&^%$#@! consistent, aren't they...
The linker reads the input file (grunt, snort,) and then ...silence... for
the greater fraction of a minute (I thought it was hung), then goes on with
the grunting and snorting, ending with the message
	Linking complete - maximum code size = 21192 ($000052C8)
and I am done.  Using the lc modules produces a runable executable instead
of the Cadavre Requester, the "He's dead Jim" and the Guru Meditation stuff.
Now guys and gals, I am not sure I have used all the optimum flags, but at
least I have a running terminal program.  So now I can try to download a
dozen megabytes of accumulated net.micro.amiga source.  Whew...
Who has a TERMCAP entry to go with this thing (or must I remain "dumb"?).
						Best Regards,	Howard Hull

[If yet unproven concepts are outlawed in the range of discussion...
                   ...Then only the deranged will discuss yet unproven concepts]
        {ucbvax!hplabs | allegra!nbires | harpo!seismo } !hao!hull

peter@baylor.UUCP (Peter da Silva) (01/01/86)

> A new invocation of LC1 from the dir "C_Programs:" actually made a quad
> file, "AmigaTerm.q" for me.  It took almost 15 minutes to do it, ...
>
> 	LC2 AmigaTerm
> A check of the dir "C_Programs" revealed that the file "AmigaTerm.q" was
> now gone, and a new file, "AmigaTerm.o" was there in its stead....
>  ...you should copy the ".q" file to a
> blank disk before the compiler metamorphosizes it.

Why? I'm not familiar with Lattice 'C' on the Amiga, but Lattice 'C' on the
IBM PC does exactly the same thing. I have never had LC2 clobber a .q file
prematurely, nor have I ever found a use for the .q file. All it is is a
compiler intermediate. Do you keep your /tmp/ctm files around on UNIX?
-- 
-- Peter da Silva
-- UUCP: ...!shell!{baylor,graffiti}!peter; MCI: PDASILVA; CIS: 70216,1076