Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!udel!mmdf From: talmage@lti.com (David Talmage) Newsgroups: comp.sys.amiga Subject: what's wrong with this picture? Message-ID: <13919@louie.udel.EDU> Date: 25 Apr 89 04:09:34 GMT Sender: mmdf@udel.EDU Lines: 33 > Ok, I give up. Why does the following (example code for a doubly-linked- > list) give the compiler warning "pointer/int conversion"? > struct aet { > long x, y; > float xIncr; > struct aet *prev; > struct aet *next; > }; > struct aet *head, *last, *this; > 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(); Without the declaration, your compiler probably thinks malloc() returns an integer. With that (struct aet *) cast, the compiler thinks you're trying to turn an integer into a pointer. David Talmage ------------------------------------------------------------------------------ David W. Talmage, Systems Programmer ...!{buita,bbn}!lti!talmage Language Technology, Inc. talmage%lti.uucp@bu-it.bu.edu 27 Congress St., Salem, MA 01970 (508) 741-1507