Re: [PATCH] repository: fix a sparse 'using integer as NULL pointer' warning
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Nov 29, 2017, 01:35 UTC
- Message-ID
- <20171129013518.GB598034@genre.crustytoothpaste.net>
- In-Reply-To
- <69fdc850-da71-6df3-5299-eb67ef5d74df@ramsayjones.plus.com>
On Tue, Nov 28, 2017 at 03:01:19AM +0000, Ramsay Jones wrote:
Show 18 quoted lines
>
> Commit 78a6766802 ("Integrate hash algorithm support with repo setup",
> 2017-11-12) added a 'const struct git_hash_algo *hash_algo' field to the
> repository structure, without modifying the initializer of the 'the_repo'
> variable. This does not actually introduce a bug, since the '0' initializer
> for the 'ignore_env:1' bit-field is interpreted as a NULL pointer (hence
> the warning), and the final field (now with no initializer) receives a
> default '0'.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Junio,
>
> I don't recall Brian doing a re-roll of the 'bc/hash-algo' branch[1], but
> now that it has been merged into the 'next' branch, sparse is barking on
> that branch too. This patch (slightly different to the last one) applies
> on top of 'next'.Thanks for the patch; it's obviously correct. I'll get sparse set up for future patch series.
-- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204