Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!COGSCI.BERKELEY.EDU!bryce
From: bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt)
Newsgroups: comp.sys.amiga
Subject: Astartup.obj
Message-ID: <8707251238.AA03602@cogsci.berkeley.edu>
Date: Sat, 25-Jul-87 08:38:38 EDT
Article-I.D.: cogsci.8707251238.AA03602
Posted: Sat Jul 25 08:38:38 1987
Date-Received: Sun, 26-Jul-87 00:47:37 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: Institute of Cognitive Studies, UC Berkeley
Lines: 34
Keywords: Gack! Astartup.obj Warning!
Summary: Read the "Workbench" chapter.

Today I had a reason to link with the "AStartup.obj" file from the Lattice C
disk.  My program stopped working.  The difficulty was traced to Astartup.obj,
and only showed up when using the Workbench.  I dragged out the source (it's in
the examples directory) and gave it a quick scan.  That was a waste of time,
so I looked a bit more carefully.  I zeroed in on argc and argv as passed
to a program started from the Workbench.  To my total amazement, the arguments
where passed in the wrong order.
The wrong order!?  I swapped them and everything was fine.  Now leery of the
quality of the code I examined it closer; several more "features" leaped into
view: if run from the CLI dos.library would never get closed, if a ToolWindow
was opened, it would never get closed, a function was called whos purpose
was to return a pointer in d0; the same pointer in fact that was already
in d0.  As I was examining a potential bug in the string handling I realized
that this was hopeless.

The solution was to whip out the assembler, and cook up a version of my
my old startup routine that could to do what I wanted.  I did, and 
delivered the finished product to the happy customer on time.  In addition
to working, my MyStartup.obj adds half the number of bytes to the
final result.

What's scary is that some software actually uses Astartup.obj.  It's strange
that I have never heard anything about these bugs... and stranger yet that
a repaired version of Astartup.obj did not come with the gamma 1 developer's
kit.  I'd send a bug report-> but this is too obvious to have been missed.

Is anyone else contemplating using, or actually using Astartup.obj with Lattice?
Did I miss an upgrade?  Or did everyone switch to Aztec? :-)

-----------------------------
|\ /|  . Ack! (NAK, EOT, SOH)
{o O} . 
( " )	bryce@cogsci.berkeley.EDU -or- ucbvax!cogsci!bryce
  U	"Success leads to stagnation; stagnation leads to failure."