From owner-freebsd-hackers Fri Feb 14 13:29:58 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA02335 for hackers-outgoing; Fri, 14 Feb 1997 13:29:58 -0800 (PST) Received: from pat.idt.unit.no (0@pat.idt.unit.no [129.241.103.5]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA02330 for ; Fri, 14 Feb 1997 13:29:55 -0800 (PST) Received: from idt.unit.no (27959@vier.idt.ntnu.no [129.241.103.4]) by pat.idt.unit.no (8.8.5/8.8.5) with ESMTP id WAA03375; Fri, 14 Feb 1997 22:29:37 +0100 (MET) Message-Id: <199702142129.WAA03375@pat.idt.unit.no> To: eivind@dimaga.com Cc: hackers@freebsd.org Subject: Re: NULL as ((void*)0) (was Re: strlen() question) In-Reply-To: Your message of "Fri, 14 Feb 1997 17:36:53 +0100" References: <3.0.32.19970214173652.00c0b290@dimaga.com> X-Mailer: Mew version 1.06 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Date: Fri, 14 Feb 1997 22:29:37 +0100 From: "Arne H. Juul" Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I hereby propose changing the default declaration of NULL under FreeBSD from > #define NULL 0 > to > #define NULL ((void*)0) > for better type-safety and ease of transition to other architechtures > (e.g. Alpha). This will probably save us from a quite a few varargs-voes, > as well as generally making sure the code-base is using NULL correctly, > which is important for those reading source-code. This *shouldn't* help. If it does, the code is broken. All code should do the right thing with varargs; if having NULL be plain 0 breaks it, so much the better :-) Broken code should be found and fixed, not nurtured. Ideally one should define NULL to plain 0 sometimes, to (void *)0 sometimes, and to (1-1) (or some other bizarre but legal option) sometimes, just to find bugs in the source tree. Just IMHO, - Arne H. J.