Newsgroups: comp.sys.transputer
From: nlshipp@dictator.uwaterloo.ca (Neil Shipp)
Subject: Inmos C and C++ compiler problems...
Organization: University of Waterloo
Date: Tue, 27 Sep 1994 22:37:37 GMT
Message-ID: <Cwt86r.BvH@watserv1.uwaterloo.ca>

Some time ago our group bought the Inmos ANSI C compiler (IMS4214B) and
the Computer Associates C++ (IMSD4217A) toolsets.  These are suppose to
run native on Sun Sparc systems.  We didn't start using these tools until
recently.

The following program will not compile with these products:

class foo
{
   int c;
public:
   foo();
};

foo::foo()  { c=0;}

int main()
{
foo *p;

    p = new foo[4];    <-- error is here
    return 0;
}

The C++ compiler translates it to C alright, but the C compiler produces 
the following output:

Error-icc-test.cxx(17)- <function argument>: implicit cast of pointer to
non-equal pointer

From what I can tell from the translated source, the c compiler is complaining
about passing the address of the constructor for foo to the __vec_new(void *,
int, int, void *(*)(void)) function.

I can use the -ec flag to turn off checks for invalid type casts, but I don't
know if that will cause the compiler to miss real problems in the code, and
code like this should compile without problems.  Is there a >real< fix for
this somewhere?

---
Neil Shipp
nlshipp@dictator.uwaterloo.ca

