Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!lll-winken!aunro!ukma!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: time(0L) - history of a misconception Message-ID: <16267@smoke.brl.mil> Date: 25 May 91 03:01:20 GMT References: <381@tmcsys.UUCP> <1991May22.130713.25852@sco.COM> <1991May24.151350.22705@holos0.uucp> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 20 In article <1991May24.151350.22705@holos0.uucp> lbr@holos0.uucp (Len Reed) writes: >Under what architecture is a NULL pointer not "all bits 0"? The problems, >as many have said, result when a pointer has fewer or more bits than >an integer (or a long). NULL pointers *are* all zeros, though, since >casting zero to a pointer must yield a null pointer. (Maybe there's >a loophole here in ANSI that says that (void *)0 is a null pointer but >the compiler could implement that casted zero as somthing other than >a pattern of zeros. Not likely in the real world.) Please don't post assertions like these when you're not sure of your facts; it adds confusion, not enlightenment. Innumerable times in the past in this newsgroup (and in comp.std.c), correct discussions of this issue have been posted, and I'm pretty sure it's in the FAQ list. In fact, in both theory and the real world, null pointers need not be represented as all zero bit patterns, nor need pointers have the same size as some integral type, nor need all pointers have the same size. There are several C implementations where one or more of those assumptions would be in error. Furthermore, these characteristics pose no problem for a programmer who avoids making such assumptions.