From owner-freebsd-chat Thu Aug 10 9:11:10 2000 Delivered-To: freebsd-chat@freebsd.org Received: from happy.checkpoint.com (happy.checkpoint.com [199.203.156.41]) by hub.freebsd.org (Postfix) with ESMTP id DE93B37B595 for ; Thu, 10 Aug 2000 09:10:58 -0700 (PDT) (envelope-from mellon@pobox.com) Received: (from mellon@localhost) by happy.checkpoint.com (8.9.3/8.9.3) id TAA12316; Thu, 10 Aug 2000 19:12:21 +0300 (IDT) (envelope-from mellon@pobox.com) Date: Thu, 10 Aug 2000 19:12:21 +0300 From: Anatoly Vorobey To: "Thomas M. Sommers" Cc: chat@freebsd.org Subject: Re: C time functions - problem Message-ID: <20000810191221.A12280@happy.checkpoint.com> References: <20000808201807.H250@parish> <20000808122832.I4854@fw.wintelcom.net> <39908B06.D1238928@mail.ptd.net> <20000809150804.L4854@fw.wintelcom.net> <39923E04.94A1B30E@mail.ptd.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <39923E04.94A1B30E@mail.ptd.net>; from tms2@mail.ptd.net on Thu, Aug 10, 2000 at 01:30:44AM -0400 Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, Aug 10, 2000 at 01:30:44AM -0400, Thomas M. Sommers wrote: > According to the (draft) standard, section 6.3.2.3: > > "An integer constant expression with the value 0, or such an expression > cast to type void *, is called a null pointer constant. If a null > pointer constant is converted to a pointer type, the resulting pointer, > called a null pointer, is guaranteed to compare unequal to a pointer to > any object or function." > > There are very few circumstances in which you need to cast 0 to make it > a null pointer constant. I am not aware of any such circumstances at all. 0 can always be used instead of NULL, and, since I find it completely unambiguous, I always use 0 for null pointers. About the only time you need to cast 0 is when you pass it to a variable-parameters function as one of the free parameters. However, in that case, you need to cast BOTH 0 and NULL. There's no difference. -- Anatoly Vorobey, mellon@pobox.com http://pobox.com/~mellon/ "Angels can fly because they take themselves lightly" - G.K.Chesterton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message