# [PATCH] builtin/reset.c: Fix a sparse warning

2 messages from 2013-01-14 to 2013-01-14. Participants: Ramsay Jones, Martin von Zweigbergk.
Thread: https://gitlist.dev/t/32626

## Ramsay Jones, 2013-01-14 19:28

Subject: [PATCH] builtin/reset.c: Fix a sparse warning
Message-ID: <50F45C7B.9030608@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/50F45C7B.9030608%40ramsay1.demon.co.uk

```

In particular, sparse issues an "symbol not declared. Should it be
static?" warning for the 'parse_args' function. Since this function
does not require greater than file visibility, we suppress this
warning by simply adding the static modifier to it's decalaration.

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

Hi Martin,

When you re-roll your "reset" patches (branch 'mz/reset-misc'), could
you please squash this into commit b24b3654 ("reset.c: extract function
for parsing arguments", 09-01-2013). Note that this patch is on top of
the pu branch (@75ea4ed3), which includes Junio's style fix patch
(commit 9f45c39f, "[SQUASH???] style fix", 10-01-2013).

Thanks!

ATB,
Ramsay Jones

 builtin/reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index a37044e..c69f9da 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -171,7 +171,7 @@ static void die_if_unmerged_cache(int reset_type)
 
 }
 
-const char **parse_args(int argc, const char **argv, const char *prefix, const char **rev_ret)
+static const char **parse_args(int argc, const char **argv, const char *prefix, const char **rev_ret)
 {
 	const char *rev = "HEAD";
 	unsigned char unused[20];
-- 
1.8.1

```

## Martin von Zweigbergk, 2013-01-14 19:35

Subject: Re: [PATCH] builtin/reset.c: Fix a sparse warning
Message-ID: <CANiSa6iaZQnoX4bGGLi1UFDr3EUeNgMf2FKvryWd9+yySJXKUA@mail.gmail.com>
URL: https://gitlist.dev/e/CANiSa6iaZQnoX4bGGLi1UFDr3EUeNgMf2FKvryWd9%2ByySJXKUA%40mail.gmail.com
In-Reply-To: <50F45C7B.9030608@ramsay1.demon.co.uk>

```
On Mon, Jan 14, 2013 at 11:28 AM, Ramsay Jones
<ramsay@ramsay1.demon.co.uk> wrote:
>
> In particular, sparse issues an "symbol not declared. Should it be
> static?" warning for the 'parse_args' function. Since this function
> does not require greater than file visibility, we suppress this
> warning by simply adding the static modifier to it's decalaration.

Oops, how did I miss that? Will fix in re-roll. Thanks.

Martin

```
