Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: (void *) ? /* again */ Keywords: coerce Message-ID: <2032@crdos1.crd.ge.COM> Date: 23 Jan 90 13:22:12 GMT References: <6200009@ux1.cso.uiuc.edu> <21771@unix.cis.pitt.edu> Reply-To: davidsen@crdos1.crd.ge.com (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 16 In article <21771@unix.cis.pitt.edu> yahoo@unix.cis.pitt.edu (Kenneth L Moore) writes: | Have you tried to coerce the type with | | plong = (long *) malloc(sizeof(long)); | | and no declaration of malloc? This way you can use malloc for several | different types of pointers in the same program. Sounds non-portable to me! If you don't declare malloc the compiler assumes an int and generates code to convert an int into an address. Since malloc doesn't return an int, in many implementations this will not work properly. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "Stupidity, like virtue, is its own reward" -me