From owner-freebsd-current@FreeBSD.ORG Thu Dec 2 11:30:26 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E70A016A4CE for ; Thu, 2 Dec 2004 11:30:26 +0000 (GMT) Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EC0243D1D for ; Thu, 2 Dec 2004 11:30:26 +0000 (GMT) (envelope-from richard@inf.ed.ac.uk) Received: from macintosh.inf.ed.ac.uk (macintosh.inf.ed.ac.uk [129.215.164.64]) by nutty.inf.ed.ac.uk (8.12.8/8.12.8) with ESMTP id iB2BUHPj017281; Thu, 2 Dec 2004 11:30:17 GMT Received: by macintosh.inf.ed.ac.uk (Postfix, from userid 501) id 79B3F1B43CC; Thu, 2 Dec 2004 11:30:17 +0000 (GMT) From: Richard Tobin To: "Brandon S. Allbery KF8NH" , =?UTF-8?Q?=E5=93=89?= In-Reply-To: Brandon S. Allbery KF8NH's message of Thu, 02 Dec 2004 00:56:17 -0500 Organization: just say no X-Mailer: Ream 5.1.51-richard-mac Message-Id: <20041202113017.79B3F1B43CC@macintosh.inf.ed.ac.uk> Date: Thu, 2 Dec 2004 11:30:17 +0000 (GMT) X-Mailman-Approved-At: Thu, 02 Dec 2004 13:22:17 +0000 cc: current@freebsd.org Subject: Re: malloc(0) returns an invalid address X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2004 11:30:27 -0000 > malloc() is required to return memory aligned for any fundamental C > type regardless of the amount of memory allocated (i.e. malloc(1) isn't > permitted to return an odd address on hardware where types larger than > (char) must be aligned). How could a conforming program tell the difference? (And so, why isn't it legal under the as-if rule?) -- Richard