git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ben Peart <peartben@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>,
	Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: Ben Peart <benpeart@microsoft.com>,
	Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH] read-cache.c: fix a sparse warning
Date: Mon, 17 Sep 2018 10:15:39 -0400	[thread overview]
Message-ID: <2efc8b66-3d26-f794-b5fe-6a4b013feeaf@gmail.com> (raw)
In-Reply-To: <CAPig+cSm52i=ypGoPGGumhP+_waq=OU2QZ=p3oVzTTzLsNpfNA@mail.gmail.com>



On 9/16/2018 3:17 AM, Eric Sunshine wrote:
> On Fri, Sep 14, 2018 at 7:29 PM Ramsay Jones
> <ramsay@ramsayjones.plus.com> wrote:
>> At one time, the POSIX standard required the type used to represent
>> a thread handle (pthread_t) be an arithmetic type. This is no longer
>> the case, probably because different platforms used to regularly
>> ignore that requirement.  For example, on cygwin a pthread_t is a
>> pointer to a structure (a quite common choice), whereas on Linux it
>> is defined as an 'unsigned long int'.
>>
>> On cygwin, but not on Linux, 'sparse' currently complains about an
>> initialiser used on a 'struct load_index_extensions' variable, whose
>> first field may be a pthread handle (if not compiled with NO_PTHREADS
>> set).
>>
>> In order to fix the warning, move the (conditional) pthread field to
>> the end of the struct and change the initialiser to use a NULL, since
>> the new (unconditional) first field is a pointer type.
>>
>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
>> ---
>> If you need to re-roll your 'bp/read-cache-parallel' branch, could you
>> please squash this into the relevant patch (commit a090af334,
>> "read-cache: load cache extensions on a worker thread", 2018-09-12).
> 
> The information contained in this commit message is so useful that it
> might make sense to plop this patch at the end of the series rather
> than merely squashing it in. (Or, if it is squashed, include the above
> explanation in the commit message of the appropriate patch.)
> 

I'm happy to squash it in if I end up re-rolling the patch series.  I'll 
include the information in the commit message above as a comment so that 
it is in close proximity to the code impacted.

  reply	other threads:[~2018-09-17 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14 23:29 [PATCH] read-cache.c: fix a sparse warning Ramsay Jones
2018-09-16  7:17 ` Eric Sunshine
2018-09-17 14:15   ` Ben Peart [this message]
2018-09-17 16:27     ` Ramsay Jones
2018-09-17 16:54       ` Ramsay Jones

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2efc8b66-3d26-f794-b5fe-6a4b013feeaf@gmail.com \
    --to=peartben@gmail.com \
    --cc=benpeart@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ramsay@ramsayjones.plus.com \
    --cc=sunshine@sunshineco.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).