From owner-cvs-all@FreeBSD.ORG Sun Sep 23 16:19:43 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E85616A419; Sun, 23 Sep 2007 16:19:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id E80DD13C469; Sun, 23 Sep 2007 16:19:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c220-239-235-248.carlnfd3.nsw.optusnet.com.au (c220-239-235-248.carlnfd3.nsw.optusnet.com.au [220.239.235.248]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l8NGJXA4023324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Sep 2007 02:19:35 +1000 Date: Mon, 24 Sep 2007 02:19:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86wsuhv70n.fsf@ds4.des.no> Message-ID: <20070924012406.I50268@delplex.bde.org> References: <200709220230.l8M2UiRK020609@repoman.freebsd.org> <86r6krqbrd.fsf@ds4.des.no> <20070922202914.B90809@besplex.bde.org> <86wsuhv70n.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-271979577-1190564373=:50268" Cc: cvs-all@FreeBSD.org, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Sean Farley , Bruce Evans Subject: Re: cvs commit: src/lib/libc/stdlib getenv.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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, 23 Sep 2007 16:19:43 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-271979577-1190564373=:50268 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 23 Sep 2007, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: >> On Sat, 22 Sep 2007, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: >>> s/to remove the warning/to actually work/ >> Please be precise :-). >> s/to remove the warning ... on 64-bit platforms/to avoid undefined behav= iour >> on platforms where size_t is not u_int, and to avoid having to make a ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> delicate analysis to show that the behaviour is defined and correct on >> all other platforms/. >> >> Delicate analysis: >> ... > you left out the case where size_t is larger than unsigned int, i.e. all > 64-bit platforms. Even if the stack is aligned to the size of size_t, > you will get interesting results on a big-endian system. Nope. This is a trivial subcase of a case that I didn't leave out. Platforms where size_t is not u_int includes all platforms where size_t is larger than u_int spelled verbosely. This is not all 64-bit platforms, but some 64-bit platforms including all 64-bit platforms supported by FreeBSD. I think stack alignment gives uninteresting results in practice even on big-endian systems, since the least significant bytes normally end up in the place where a type pun will see them by going through a register. This is most obvious if they are passed in a register, which can happen even for variadic args -- then endianness has no significant effect. I think lots of code still depends on the alignment to make things sort of work. Bruce --0-271979577-1190564373=:50268--