From: Jeff King <peff@peff.net>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH] builtin/config.c: Fix a sparse warning
Date: Mon, 29 Oct 2012 01:47:02 -0400 [thread overview]
Message-ID: <20121029054702.GD30186@sigill.intra.peff.net> (raw)
In-Reply-To: <508D9E15.1040105@ramsay1.demon.co.uk>
On Sun, Oct 28, 2012 at 09:05:25PM +0000, Ramsay Jones wrote:
> Sparse issues an "Using plain integer as NULL pointer" warning while
> checking a 'struct strbuf_list' initializer expression. The initial
> field of the struct has pointer type, but the initializer expression
> is given as '{0}'. In order to suppress the warning, we simply replace
> the initializer with '{NULL}'.
I slightly disagree with sparse here, as the 0 here is not about
explicitly setting the pointer, but is an idiomatic shorthand for
requesting static-like initialization (and it is purely a style thing,
not a bug, as 0 is a fine null pointer, even on platforms without
all-bits-zero null pointers).
But I think it is still worth changing in the name of
sparse-cleanliness. Thanks.
> I try to catch these types of warnings while the patches are still
> in the pu branch. I don't know how I missed this one, but I don't
> remember your 'jk/config-ignore-duplicates' branch being in pu.
>
> Sorry about that.
Not your fault. The time during which it would have been in pu was after
Junio left but before I had pushed out my pu. I did have it locally in
pu for a bit, but it ended up on next the first time it was published,
because the series had already received favorable review on the list in
the meantime.
But I forgot that some people may first see the new code via the
published pu, not the list (e.g., if they are pulling and building pu
routinely with sparse). I'll try to be better about making sure stuff
is actually published in pu for a cycle before merging to next.
-Peff
prev parent reply other threads:[~2012-10-29 5:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-28 21:05 [PATCH] builtin/config.c: Fix a sparse warning Ramsay Jones
2012-10-29 5:47 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121029054702.GD30186@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).