atari email archive

a collection of messages sent at Atari from 1983 to 1992.

CERROR

(1 / 1)


TPU and GREENHILLS C users:

A new TPU/EDT function has been added to TPU and I need your help to see if
it works. At the moment this function only works for those of you that use
the GREENHILLS C compiler (if enough people scream for it 'cerror' could be
modified to accept error files generated by different compilers or
assemblers). The new function is called: 
	
	cerr*or [filename][.err]

and is invoked on the TPU/EDT command line (GOLD_KP7).  'cerror' reports
errors that have occurred during compilation. It does this by first reading
in a file (to another buffer) that contains the errors and then searching
that file for line numbers where the errors occurred. The file search will
default to your working directory and if a file is not specified will look
for a file that matches your current edit file that has an extension of
.err. You may also specify a file on the command line. 

For example; after typing GOLD_KP7, you type

	cerr

at the TPU/EDT command line, 'cerror' will look in your current directory for
the filename that matches the file that you're editing (the main_buffer's
file) with an extension of .err. 

	'cerror' will then look for the first occurrance of an error,
display that error in the message window (bottom of screen), and move the
cursor to the line where the error occurred. To find subsequent errors it's
best to bind a key to the function. I suggest using the PF2 key. Therefore
add this line to your tpu$init file: 

baf$x_error_next := 'define_key("baf$error_next(current_direction)",pf2)';

By hitting the PF2 key you can find the next error. 'cerror' will also work
in the REVERSE direction. 

You must have an error file that was created by the GREENHILLS compiler. You
can obtain this file by redirecting GREENHILLS error reporting to a file. I
do this by adding this to my MAKEFILE.:

myfile.ol : myfile.c 
	$ assign/user myfile.err sys$error
	$ ncc -O -Z29 myfile.c

KNOWN BUGS:

	* If you call 'cerror' more than once, TPU will report an error.
	* 'cerror' does not know if you have edited your source file. So
	  if your error correction involved deleting or adding more 
	  or less than what you started out with, the next error reported will
	  be off by that many lines. (you could edit starting from the bottom
	  but most C errors occur because of the first one)

- brad -
Message 1 of 1

Mar 06, 1986