Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!husc6!bloom-beacon!apple!bionet!agate!ucbvax!decwrl!pyramid!prls!mips!sultra!dtynan From: dtynan@sultra.UUCP (Der Tynan) Newsgroups: comp.os.minix Subject: Re: Minix/ST problems. Message-ID: <2598@sultra.UUCP> Date: 25 Oct 88 04:16:13 GMT Article-I.D.: sultra.2598 References: <249@cstw01.UUCP> Organization: Tynan Computers, Sunnyvale, CA Lines: 23 In article <249@cstw01.UUCP>, meulenbr@cstw01.UUCP (Frans Meulenbroeks) writes: > > This is a killer on an ST since sizeof(char *) == 32 and sizeof(int) == 16. > Solution: change the 0 in (char *)0 > > Frans Meulenbroeks (meulenbr@cst.prl.philips.nl) Hmmm. I've always been partial to the idea that sizeof(char *) == sizeof(int). In fact, I've seen a lot of code (not necessarily my own), which assumes this. If one needs sizeof(int) == 16, then use short. It's my belief that if you have a true 32-bit address space (lucky you), then there's no reason to keep ints to a small size. Of course, one should always use casts with NULL anyway. I don't know, offhand, of any compiler that requires this, but it's good practice, as shown by your problem. NULL is best left as 0, and for instance, if ((memptr = malloc(BUFSIZE)) == (char *)NULL) etc(); Hope this helps! - Der -- Reply: dtynan@sultra.UUCP (Der Tynan @ Tynan Computers) {mips,pyramid}!sultra!dtynan Cast a cold eye on life, on death. Horseman, pass by... [WBY]