From owner-cvs-all@FreeBSD.ORG Sun Dec 7 13:10:08 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D16A16A4D0; Sun, 7 Dec 2003 13:10:08 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66ABF43FDF; Sun, 7 Dec 2003 13:10:07 -0800 (PST) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hB7LA7XJ001461; Sun, 7 Dec 2003 13:10:07 -0800 (PST) (envelope-from marcel@repoman.freebsd.org) Received: (from marcel@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hB7LA7pO001460; Sun, 7 Dec 2003 13:10:07 -0800 (PST) (envelope-from marcel) Message-Id: <200312072110.hB7LA7pO001460@repoman.freebsd.org> From: Marcel Moolenaar Date: Sun, 7 Dec 2003 13:10:06 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/include dirent.h locale.h stddef.h stdio.h stdlib.h string.h time.h unistd.h wchar.h src/include/rpc types.h src/sys/sys _null.h param.h stddef.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2003 21:10:08 -0000 marcel 2003/12/07 13:10:06 PST FreeBSD src repository Modified files: include dirent.h locale.h stddef.h stdio.h stdlib.h string.h time.h unistd.h wchar.h include/rpc types.h sys/sys param.h stddef.h Added files: sys/sys _null.h Log: Change the definition of NULL on ia64 (for LP64 compilations) from an int constant to a long constant. This change improves consistency in the following two ways: 1. The first 8 arguments are always passed in registers on ia64, which by virtue of the generated code implicitly widens ints to longs and allows the use of an 32-bit integral type for 64-bit arguments. Subsequent arguments are passed onto the memory stack, which does not exhibit the same behaviour and consequently do not allow this. In practice this means that variadic functions taking pointers and given NULL (without cast) work as long as the NULL is passed in one of the first 8 arguments. A SIGSEGV is more likely the result if such would be done for stack-based arguments. This is due to the fact that the upper 4 bytes remain undefined. 2. All 64-bit platforms that FreeBSD supports, with the obvious exception of ia64, allow 32-bit integral types (specifically NULL) when 64-bit pointers are expected in variadic functions by way of how the compiler generates code. As such, code that works correctly (whether rightfully so or not) on any platform other than ia64, may fail on ia64. To more easily allow tweaking of the definition of NULL, this commit removes the 12 definitions in the various headers and puts it in a new header that can be included whenever NULL is to be made visible. This commit fixes GNOME, emacs, xemacs and a whole bunch of ports that I don't particularly care about at this time... Revision Changes Path 1.14 +2 -4 src/include/dirent.h 1.8 +2 -4 src/include/locale.h 1.11 +2 -4 src/include/rpc/types.h 1.10 +1 -4 src/include/stddef.h 1.52 +1 -4 src/include/stdio.h 1.55 +1 -4 src/include/stdlib.h 1.19 +1 -4 src/include/string.h 1.31 +1 -4 src/include/time.h 1.70 +1 -4 src/include/unistd.h 1.36 +1 -4 src/include/wchar.h 1.1 +37 -0 src/sys/sys/_null.h (new) 1.176 +2 -4 src/sys/sys/param.h 1.2 +1 -4 src/sys/sys/stddef.h