From owner-svn-src-head@FreeBSD.ORG Fri May 11 13:10:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6279106566B; Fri, 11 May 2012 13:10:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 38B7E8FC1B; Fri, 11 May 2012 13:10:11 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4BD9ui4035706; Fri, 11 May 2012 16:09:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4BD9t4S035591; Fri, 11 May 2012 16:09:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4BD9tIk035590; Fri, 11 May 2012 16:09:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 May 2012 16:09:55 +0300 From: Konstantin Belousov To: David Chisnall Message-ID: <20120511130955.GO2358@deviant.kiev.zoral.com.ua> References: <201205111237.q4BCbGX2083596@svn.freebsd.org> <20120511124820.GN2358@deviant.kiev.zoral.com.ua> <6AE99277-D90F-453D-AE40-EE731DFD3BAB@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OpylS7L25zwHG0dS" Content-Disposition: inline In-Reply-To: <6AE99277-D90F-453D-AE40-EE731DFD3BAB@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua 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 13:10:36 -0000 --OpylS7L25zwHG0dS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 11, 2012 at 08:57:29AM -0400, David Chisnall wrote: > On 11 May 2012, at 08:48, Konstantin Belousov wrote: >=20 > > 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 bin= ary > > on the disk as the consequence. >=20 > 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. The initialized variables are placed in .data and not .bss. Apparently, some compilers do an optimiziation and put zero-initialized objects into .bss, as Colin noted, but this is not guaranteed behaviour. If placed in .data, they do consume disk space. Redundand initialization is not encouraged by style as well. >=20 > 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. local variables are irrelevant there. >=20 > David >=20 > [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. --OpylS7L25zwHG0dS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+tD6MACgkQC3+MBN1Mb4hi0gCfVDlGEYE0YUxXCKY4chkd/3cb 98wAoKFhikWfcz1UoO1ZArgMWHBob+ui =F/Dd -----END PGP SIGNATURE----- --OpylS7L25zwHG0dS--