Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uunet!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Re: malloc under Lattice C V5.05 Message-ID: <6620@sugar.hackercorp.com> Date: 23 Sep 90 15:08:14 GMT References: <3034@orbit.cts.com> <1990Sep23.061925.6887@jato.jpl.nasa.gov> Reply-To: peter@sugar.hackercorp.com (Peter da Silva) Organization: Sugar Land Unix - Houston Lines: 22 In article <1990Sep23.061925.6887@jato.jpl.nasa.gov> zupke@mars.UUCP (Brian Zupke) writes: > In this case, the pointer mismatch can be eliminated by "casting" the > malloc function to type char. For example: > char *outname; > outname = (char *)malloc(SomeConstant); But the underlying problem, that malloc() is declared as returning an int (by not being declared at all) still needs to be fixed. Try adding void *malloc(); somewhere in scope. You may still need to ast it, but at least your code will still work when (int) and (void *) are no longer the same size. (As an aside: most 68000 compilers I've used in the past have returned pointers in A0 and ints in D0. Seems like an obvious move. I guess Manx and Lattice had other priorities.) -- Peter da Silva. `-_-' .