Subject: Re: [PATCH 03/10] fast-export: store anonymized oids as hex strings

From: SZEDER Gábor <[email-masked]>
Date: Thu, 25 Jun 2020 22:45:32 +0200

On Thu, Jun 25, 2020 at 11:49:48AM -0400, Jeff King wrote:
> On Wed, Jun 24, 2020 at 11:54:20AM -0400, Jeff King wrote:
> 
> > > GCC 4.8 complains about this change in our CI job:
> > > 
> > >   $ make CC=gcc-4.8 builtin/fast-export.o
> > >       CC builtin/fast-export.o
> > >   builtin/fast-export.c: In function ‘generate_fake_oid’:
> > >   builtin/fast-export.c:394:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
> > >     put_be32(oid.hash + hashsz - 4, counter++);
> > >     ^
> > >   cc1: all warnings being treated as errors

> So this really seems like a pointless false positive from the compiler,
> and it's a rather old compiler (the warning no longer triggers in gcc 6
> and up). Is it worth caring about? Ubuntu Trusty is out of standard
> support but not fully EOL'd until 2022. Debian jessie has gcc 4.9
> which triggers the warning, but will hit EOL in 5 days. If it were an
> actual breakage I'd be more concerned, but keeping such an old compiler
> -Werror clean doesn't seem that important.
> 
> I'd note also that none of the Actions CI jobs run with this compiler
> version. If we _do_ want to care about it, it might be worth covering it
> there.

C99 style 'for' loop initial declarations are still frowned upon in
Git's codebase, and as far as we know it GCC 4.8 is the the most
recent compiler that can reasonably detect it; see fb9d7431cf
(travis-ci: build with GCC 4.8 as well, 2019-07-18).