lotus

previous page: 9.2: What are the common problems encountered when porting UNIX sourceto GNO?
  
page up: comp.sys.apple2. gno FAQ
  
next page: 10.1: Which language should I use?

9.3: Are there any other recommendations for porting programs?




Description

This article is from the Apple II GNO FAQ, by Devin Reade with numerous contributions by others.

9.3: Are there any other recommendations for porting programs?

    A#9.3:	There probably are as many opinions as there are programmers.
However, here is a list that seems to work well.  Using C as
the source language is assumed:

- Use the occ(1) "-w" flag (#pragma lint -1) whenever possible.
  You will have to modify your code if it doesn't use prototypes,
  but this is more likely to catch errors and incorrect assumptions.
  If you really need to be compatible with K&R compilers, you
  can use the following paradigm in your code:

	#include <sys/cdefs.h>
	int main __P((int argc, char **argv));

	int main
	#ifdef __STDC__
	(int argc, char **argv)
	#else
	(argc, argv)
	#endif
		int argc;
		char **argv;
	{
		...

  You may have to prototype some of your system header files.
  This should not be necessary with the ORCA/C v2.1 header files
  (they're already prototyped), but is likely necessary with
  earlier versions and some of the GNO v2.0.4 (and earlier) system
  header files.  See also Q#6.2 and Q#6.6.

- Whenever possible, compile with the occ(1) "-G25" during
  development.  This will ensure that, in the event of stack
  trashing and similar problems, that you get a meaningful
  traceback and that your machine (usually) doesn't crash.

  If you are using the Splat! debugger, you should use "-g" instead
  of "-G25".  See also the notes on fork(2) in question Q#9.2.

  Make sure you read the both the ORCA/C manual and release notes;
  there are times (such as within variadic functions) that you
  cannot use stack checking or repair code.

  When you're finished development, you can replace the debugging
  flag with "-O" for optimization.  Don't forget to test your
  optimized program before you release it!
    

 

Continue to:













TOP
previous page: 9.2: What are the common problems encountered when porting UNIX sourceto GNO?
  
page up: comp.sys.apple2. gno FAQ
  
next page: 10.1: Which language should I use?