[comp.sys.atari.st] Lattice C - Help!

markhof@exunido.uucp (Ingolf Markhof) (08/30/88)

The Lattice C compiler prints its error messages on the screen. This is only
less helpful. I'd like to get the error messages written into a file. So, how
can I tell the compiler to write such a file?

Ingolf Markhof

leo@philmds.UUCP (Leo de Wit) (08/31/88)

In article <571@laura.UUCP> markhof@exunido.UUCP (Ingolf Markhof) writes:
>The Lattice C compiler prints its error messages on the screen. This is only
>less helpful. I'd like to get the error messages written into a file. So, how
>can I tell the compiler to write such a file?

I don't have the newest version of Lattice C, so things might have changed...

If you start LC1.TTP and LC2.TTP yourself (I mean: not using LC.TTP) you
can use redirection in the command string offered to these programs (they
handle redirection themselves); e.g.

    LC1.TTP >error1.out lc1_options myfile
    LC2.TTP >error2.out lc2_options myfile

Note that the redirection must be the first argument, or it will be
misinterpreted. Also note that you have to quote the '>' if you're
running from a shell that handles redirection (<,>,<<,>>), or else the
shell will try to do the redirection (which might fail).

There's another annoying fact about Lattice discriminating between console
and file output (again, maybe it has changed):

If you use LC.TTP to compile, you will notice it will wait for a keypress
before finishing. This is quite annoying if you run from a make program, or
use batch processing. I can understand why it has been done: to be able
to see the compiler output before returning to the Desktop.
If you use LC1.TTP and LC2.TTP to compile, you will see they also wait
for a keypress before finishing. The odd thing is, they don't wait when
started from LC.TTP (this one starts them each in turn). The reason is
that LC.TTP starts them each with a first argument of '>CON:'; this
value is treated as a special one by both LC1.TTP and LC2.TTP.

When I found out about all that, I decided to write my own cc program
that starts the LC1.TTP and LC2.TTP with a first argument of '>CON:',
also starts the linker LINK.TTP with a suitable link description file,
handles its parameters more 'a la Unix' and DOES NOT WAIT FOR A KEYPRESS.
(If someone's interested, mail me).
The output is still directed to the console, but that's no problem:
if fastdump.prg is installed (can even start it at that moment) an
Alt-Help will do a fast ascii screen dump to my printer, which is even
nicer than having error messages in a file (unless you have something
like the Unix utility error that can merge an error file into your
source file).

Hope this helps you out -
                                 Leo.

br@laura.UUCP (Bodo Rueskamp) (09/02/88)

In article <784@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes:
>If you use LC1.TTP and LC2.TTP to compile, you will see they also wait
>for a keypress before finishing. The odd thing is, they don't wait when
>started from LC.TTP (this one starts them each in turn). The reason is
>that LC.TTP starts them each with a first argument of '>CON:'; this
>value is treated as a special one by both LC1.TTP and LC2.TTP.

No! Try:

	LC1.TTP -. options... files...

                ^^-- this is the magic option

If you use the -. option, the compiler doesn't ask for a return on exit.

This undocumented option works on Lattice C 3.04.1 and 3.04.2.
I found this feature by scanning all options letters from 0x21 to 0x7e.

--
Bodo Rueskamp
br@unido.uucp
..!uunet!unido!br

leo@philmds.UUCP (Leo de Wit) (09/03/88)

In article <573@laura.UUCP> br@unido.UUCP (Bodo Rueskamp) writes:
|In article <784@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes:
|>If you use LC1.TTP and LC2.TTP to compile, you will see they also wait
|>for a keypress before finishing. The odd thing is, they don't wait when
|>started from LC.TTP (this one starts them each in turn). The reason is
|>that LC.TTP starts them each with a first argument of '>CON:'; this
|>value is treated as a special one by both LC1.TTP and LC2.TTP.
|
|No! Try:
|
|	LC1.TTP -. options... files...
|
|                ^^-- this is the magic option
|
|If you use the -. option, the compiler doesn't ask for a return on exit.
|
|This undocumented option works on Lattice C 3.04.1 and 3.04.2.
|I found this feature by scanning all options letters from 0x21 to 0x7e.

Bodo, your magic undocumented option does not work with Lattice 3.03:

    Invalid command line option

is what I get. I help you hope that it *WILL* work with future releases
of Lattice; if not, you will have to rebuild the tools you made upon this
'feature', when it gets fixed.
The redirection is less likely to get you into trouble, 'cause it's
a valid command line option for both LC.TTP, LC1.TTP and LC2.TTP.

B.T.W. Have you tried it (>CON:), Bodo?
       Your No! seems so forbidding 8-)!

                 Leo.