Re: [PATCH 1/3] test-tool genzeros: initialize "zeros" to avoid SunCC warning
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 12, 2022, 19:10 UTC
- Message-ID
- <Yd8njHz2m099iDfL@nand.local>
- In-Reply-To
- <nycvar.QRO.7.76.6.2201121518360.2121@tvgsbejvaqbjf.bet>
On Wed, Jan 12, 2022 at 03:21:46PM +0100, Johannes Schindelin wrote:
Show 17 quoted lines
> > diff --git a/t/helper/test-genzeros.c b/t/helper/test-genzeros.c
> > index 8ca988d6216..5dc89eda0cb 100644
> > --- a/t/helper/test-genzeros.c
> > +++ b/t/helper/test-genzeros.c
> > @@ -3,8 +3,7 @@
> >
> > int cmd__genzeros(int argc, const char **argv)
> > {
> > - /* static, so that it is NUL-initialized */
> > - static const char zeros[256 * 1024];
> > + const char zeros[256 * 1024] = { 0 };
>
> This diff does two things: add an initializer, and turn the variable into
> a `static`. The former is the actual fix that is required. The latter is
> not. During the -rc phase, we do not want to see any of the latter. It is
> unnecessarily controversial and distracting, and can easily be postponed
> until January 25th, 2022.This assumes that making the declaration non-static isn't necessary to fix the warning from SunCC.
I would guess that in reality it probably isn't, so removing the static designation is a stray change, and this would have been easier to grok as simply:
- static const char zeros[256 * 1024];
+ static const char zeros[256 * 1024] = { 0 };But to be honest I don't think it is _that_ big of a deal to make such a small change during this point of the development cycle.
Thanks, Taylor