Porting MPW C code to A/UX, Can some one give me a hand?

David J Peterson djp862 at anu.oz.au
Thu Jun 6 17:17:53 AEST 1991


I'm trying to port some code written in MPW C to A/UX and am having
some trouble with the variable argument declarations in MPW C.

In MPW the function are prototyped as:

function( int, ... )	/* one int, and then none to ? _ints_ */

then in the function definition:

#define PARM	, var
#define DECL	int var;

function( int, PARM )
  int anInt;
  DECL
{
 ...
}


The functions are expecting a list of integers (not a character
string) to be passed as the variable argument list. MPW C has no
problem compiling this, but A/UX cc (and gcc) just chokes with "number
of arguments doesn't match prototype" on the function definition line
(not the prototype).

Replacing the '...' with 'int' in the prototype allows it to compile
under A/UX, but loses the variable argument functionality.

Does anyone know how to kick A/UX into accepting this? (the
-traditional flag in gcc doesn't do it).

Thanks,
-dave.



More information about the Comp.unix.aux mailing list