From: Stephen Boyd <bebarino@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: [PATCHv2 2/2] Fix sparse warnings
Date: Mon, 21 Mar 2011 15:04:32 -0700 [thread overview]
Message-ID: <AANLkTinYCqK6zm17O_HedOFtbN6VRhYQbFj-YNk+JrV1@mail.gmail.com> (raw)
In-Reply-To: <7vd3lknnjy.fsf@alter.siamese.dyndns.org>
On Mon, Mar 21, 2011 at 2:58 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Still yeek...
>>
>> What I meant was more like at the minimum:
>> ...
>> or much more preferably:
>>
>> - These files use symbols without declaring, because they do not include
>> "builtin.h":
>>
>> builtin/clone.c (cmd_clone), builtin/fetch-pack.c (cmd_fetch_pack), ...
>>
>> - These files define extern symbols without declaring, and they can be
>> file scope static:
>>
>> builtin/fmt-merge-msg.c (init_src_data), ...
>>
>> - These callsites pass literal integer 0 where they mean to pass a NULL
>> pointer:
>>
>> builtin/notes.c (resolve_ref), ...
>>
>> The patch text itself look more or less Ok, but I see you have builtin.h
>> not as the first include in builtin/pack-redundant.c.
>>
Ah ok, I can do that.
>
> I spotted these two. thread-utils.h already includes pthread.h, and
> builtin.h should come before (though technically exec_cmd.h does not
> depend on any external types, so this is just a conformity issue, not
> correctness one).
>
> Again, thanks.
>
> builtin/pack-redundant.c | 2 +-
> thread-utils.c | 1 -
> 2 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
> index 760b377..a15e366 100644
> --- a/builtin/pack-redundant.c
> +++ b/builtin/pack-redundant.c
> @@ -6,8 +6,8 @@
> *
> */
>
> -#include "exec_cmd.h"
> #include "builtin.h"
> +#include "exec_cmd.h"
>
> #define BLKSIZE 512
>
> diff --git a/thread-utils.c b/thread-utils.c
> index 2c8c1e3..7f4b76a 100644
> --- a/thread-utils.c
> +++ b/thread-utils.c
> @@ -1,5 +1,4 @@
> #include "cache.h"
> -#include <pthread.h>
> #include "thread-utils.h"
>
> #if defined(hpux) || defined(__hpux) || defined(_hpux)
>
Ok, I'll squash these in and resend tonight when I get home.
Also, I don't think exec_cmd.h is actually used in some of the builtin
C files (due to some setup fallouts) so I think we can probably just
remove the exec_cmd.h includes if they're within contex and unused.
I'll do that next round.
next prev parent reply other threads:[~2011-03-21 22:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 9:45 [PATCH 1/2] Makefile: Cover more files with make check Stephen Boyd
2011-03-21 9:45 ` [PATCH 2/2] Fix sparse warnings Stephen Boyd
2011-03-21 10:10 ` Johannes Sixt
2011-03-21 10:12 ` Stephen Boyd
2011-03-21 16:12 ` Junio C Hamano
2011-03-21 16:15 ` Junio C Hamano
2011-03-21 18:01 ` [PATCHv2 " Stephen Boyd
2011-03-21 19:29 ` Junio C Hamano
2011-03-21 21:58 ` Junio C Hamano
2011-03-21 22:04 ` Stephen Boyd [this message]
2011-03-22 7:51 ` [PATCHv3 " Stephen Boyd
2011-03-22 17:18 ` Junio C Hamano
2011-03-21 17:27 ` [PATCH 1/2] Makefile: Cover more files with make check Junio C Hamano
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=AANLkTinYCqK6zm17O_HedOFtbN6VRhYQbFj-YNk+JrV1@mail.gmail.com \
--to=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
/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).