Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ig!bionet!agate!ucbvax!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!nuchat!sugar!karl From: karl@sugar.hackercorp.com (Karl Lehenbauer) Newsgroups: comp.sys.amiga Subject: Re: what's wrong with this picture? Message-ID: <3753@sugar.hackercorp.com> Date: 26 Apr 89 00:36:11 GMT References: <13919@louie.udel.EDU> Organization: Sugar Land Unix - Houston Lines: 24 In article <13919@louie.udel.EDU>, talmage@lti.com (David Talmage) writes: > > Ok, I give up. Why does the following (example code for a doubly-linked- > > list) give the compiler warning "pointer/int conversion"? > > head = (struct aet *) malloc(sizeof(struct aet)); > > /* warning comes ^ here */ > I think I can answer this one. It just bit me last week. > Try declaring malloc. Probably like this: > extern char *malloc(); Netter Talmage is correct. People using small model (16-bit ints) can save themselves a lot of grief, and all of us can suppress the warnings, with a simple: #include ...at the start of every every C source file. P.S. Use AllocMem rather than malloc. -- -- uunet!sugar!karl | "Nobody hipped me to that, dude." -- Pee Wee -- Usenet BBS (713) 438-5018