Path: utzoo!mnetor!uunet!husc6!uwvax!oddjob!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Header problems Message-ID: <10612@mimsy.UUCP> Date: 10 Mar 88 18:04:34 GMT References: <3351@chinet.UUCP> <121@polygen.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 24 [This makes three.] In article <121@polygen.UUCP> pablo@polygen.uucp (Pablo Halpern) writes: >For compilers that don't support (void *), you must have >a compiler-specific definition of NULL: No. > #define NULL 0 /* If sizeof(int) == sizeof(char *) */ > or > #define NULL 0L /* if sizeof(long) == sizeof(char *) */ Either is technically legal. The former suffices, is not machine dependent, and is correct. >Since the above #defines are necessarily machine (and compiler) specific, The definition of NULL (as 0, or if you have a dpANS-conformant compiler, as (void *)0) is not machine dependent. What *is* machine dependent is whether uncasted 0 in unprototyped function calls appears to work. Using uncasted 0L appears to work (but is nonetheless wrong) on IBM PCs using large model compilers. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris