Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2012 15:33:23 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Colin Percival <cperciva@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan <gabor@freebsd.org>
Subject:   Re: svn commit: r235267 - in head/usr.bin/sort: . nls
Message-ID:  <4FAD1523.2040501@FreeBSD.org>
In-Reply-To: <4FAD0DF4.9000609@freebsd.org>
References:  <201205111237.q4BCbGX2083596@svn.freebsd.org> <20120511124820.GN2358@deviant.kiev.zoral.com.ua> <4FAD0DF4.9000609@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2012-05-11 15:02, Colin Percival wrote:> On 05/11/12 05:48, Konstantin Belousov wrote:
>> On Fri, May 11, 2012 at 12:37:16PM +0000, Gabor Kovesdan wrote:
>>> +bool byte_sort = false; + +static wchar_t **wmonths = NULL; +static
>>> unsigned char **cmonths = NULL;
>>
>> Such initializations are useless. You only increase the size of the binary 
>> on the disk as the consequence.
> 
> I just tested this hypothesis, and found no change in binary size using
> either clang or gcc46.  Presumably they're smart enough to ignore explicit
> (and unnecessary) initializations of statics to zero.

This is default behaviour, which can be toggled with gcc's (and clang's)
command line option -fno-zero-initialized-in-bss:

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fno_002dzero_002dinitialized_002din_002dbss-744



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FAD1523.2040501>