Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!phil From: phil@ux1.cso.uiuc.edu Newsgroups: comp.lang.c Subject: (void *) ? /* again */ Message-ID: <6200009@ux1.cso.uiuc.edu> Date: 19 Jan 90 10:48:12 GMT Lines: 24 Nf-ID: #N:ux1.cso.uiuc.edu:6200009:000:785 Nf-From: ux1.cso.uiuc.edu!phil Jan 18 23:09:00 1990 I have read (but I'm not sure where, I think it was in H&S) that when you have the type (void *) then its effectively matches any pointer. For instance, malloc is declared like: void * malloc(); and you should be able to use it like: long * plong; plong = malloc( sizeof(long) ); But the compilers I have used so far all give warnings about this, saying that the types are incompatible. Granted they are only warnings, and in the case of unix, the -w flag will suppress them, I really WOULD like to see other "legit" warnings. Is this considered a "legit" warning? Have I exceeded the bounds of C rules? How can I suppress the "void" warnings and keep others w/o having to have casts all over my code? --Phil Howard, KA9WGN--