[net.lang.c++] c++ version 1.1 incompatibility with 4.3bsd C compiler

rudell@ucbcad.BERKELEY.EDU (Richard Rudell) (10/31/86)

The following does not compile with Version 1.1 of cfront on a bsd 4.3 VAX:


	#include <complex.h>

	main()
	{
	    complex a = complex(5.0,7.0);
	    complex b = complex(4.5,3.2);
	    complex c = complex(4.5,3.2);

	    complex d = a + b + c;
	}


The compiler produces the error message:
	CC  com.c:
	cc   com..c -lC
	"/usr/include/CC/complex.h", line 44: redeclaration of _plusFCcomplex__Ccomplex___
	mv: com..o: Cannot access: No such file or directory


The problem is that the declarations (taken from the cfront output):

		.
		.

	#line 44 "/usr/include/CC/complex.h"
	extern struct complex _plusFCcomplex__Ccomplex___ ();
		.
		.
		.
	#line 44 "/usr/include/CC/complex.h"
	static struct complex _plusFCcomplex__Ccomplex___ ();


are considered illegal by the 4.3 compiler.  Apparently cfront is
creating a static function because of an inability to fully expand
the complex addition in-line.

Any simple fix ?


Thanks,
Rick Rudell.