git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] clone: Make the 'junk_mode' symbol a file static
@ 2013-04-27 18:39 Ramsay Jones
  2013-04-27 23:21 ` Jeff King
  2013-04-28  1:55 ` Eric Sunshine
  0 siblings, 2 replies; 3+ messages in thread
From: Ramsay Jones @ 2013-04-27 18:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list


Sparse issues an "'junk_mode' not declared. Should it be static?"
warning. In order to suppress the warning, since this symbol does
not need more than file visibility, we simply add the static
modifier to it's declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 58fee98..035ab64 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -387,7 +387,7 @@ static void clone_local(const char *src_repo, const char *dest_repo)
 static const char *junk_work_tree;
 static const char *junk_git_dir;
 static pid_t junk_pid;
-enum {
+static enum {
 	JUNK_LEAVE_NONE,
 	JUNK_LEAVE_REPO,
 	JUNK_LEAVE_ALL
-- 
1.8.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/6] clone: Make the 'junk_mode' symbol a file static
  2013-04-27 18:39 [PATCH 1/6] clone: Make the 'junk_mode' symbol a file static Ramsay Jones
@ 2013-04-27 23:21 ` Jeff King
  2013-04-28  1:55 ` Eric Sunshine
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2013-04-27 23:21 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list

On Sat, Apr 27, 2013 at 07:39:04PM +0100, Ramsay Jones wrote:

> Sparse issues an "'junk_mode' not declared. Should it be static?"
> warning. In order to suppress the warning, since this symbol does
> not need more than file visibility, we simply add the static
> modifier to it's declaration.
> [...]
> -enum {
> +static enum {
>  	JUNK_LEAVE_NONE,

Thanks. This one was done by me, and yes it should be static. I think it
is because I originally typed:

  enum junk_mode {
    ...
  };
  static enum junk_mode junk_mode;

and then later dropped the named type, but forgot to keep the static
keyword.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/6] clone: Make the 'junk_mode' symbol a file static
  2013-04-27 18:39 [PATCH 1/6] clone: Make the 'junk_mode' symbol a file static Ramsay Jones
  2013-04-27 23:21 ` Jeff King
@ 2013-04-28  1:55 ` Eric Sunshine
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Sunshine @ 2013-04-28  1:55 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list

On Sat, Apr 27, 2013 at 2:39 PM, Ramsay Jones
<ramsay@ramsay1.demon.co.uk> wrote:
> Sparse issues an "'junk_mode' not declared. Should it be static?"
> warning. In order to suppress the warning, since this symbol does
> not need more than file visibility, we simply add the static
> modifier to it's declaration.

s/it's/its/

> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-28  1:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-27 18:39 [PATCH 1/6] clone: Make the 'junk_mode' symbol a file static Ramsay Jones
2013-04-27 23:21 ` Jeff King
2013-04-28  1:55 ` Eric Sunshine

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).