From owner-svn-src-head@FreeBSD.ORG Fri May 11 12:57:30 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7EC106564A; Fri, 11 May 2012 12:57:30 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id 669348FC0A; Fri, 11 May 2012 12:57:30 +0000 (UTC) Received: from [192.168.14.46] ([24.114.252.244]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id q4BCvTvt074436 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 11 May 2012 12:57:29 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120511124820.GN2358@deviant.kiev.zoral.com.ua> Date: Fri, 11 May 2012 08:57:29 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <6AE99277-D90F-453D-AE40-EE731DFD3BAB@FreeBSD.org> References: <201205111237.q4BCbGX2083596@svn.freebsd.org> <20120511124820.GN2358@deviant.kiev.zoral.com.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Gabor Kovesdan Subject: Re: svn commit: r235267 - in head/usr.bin/sort: . nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2012 12:57:30 -0000 On 11 May 2012, at 08:48, Konstantin Belousov wrote: > On Fri, May 11, 2012 at 12:37:16PM +0000, Gabor Kovesdan wrote: >> Author: gabor >> Date: Fri May 11 12:37:16 2012 >> New Revision: 235267 >> URL: http://svn.freebsd.org/changeset/base/235267 >=20 >> +bool byte_sort =3D false; >> + >> +static wchar_t **wmonths =3D NULL; >> +static unsigned char **cmonths =3D NULL; >=20 > Such initializations are useless. You only increase the size of the = binary > on the disk as the consequence. Really? The C specification requires all globals and statics that are = not explicitly initialised to be set to their zero value, so this = initialisation has no effect on the resulting binary[1]. These are = placed in the BSS section, irrespective of whether the initialisation is = implicit or explicit and the loader is responsible for allocating space = for them - all that is stored in the binary is the size. For local variables, initialisation like this has no effect even at low = optimisation levels - dead stores will be removed. It does, however, = make it more difficult for the compiler to distinguish between = initialised and initialised sensibly in some cases. David [1] In a standards-compliant compiler. Apparently a few shipping = compilers for embedded systems fail to respect this, but everything = FreeBSD is compiled with does.=