# [PATCH 1/6] config.c: Fix a sparse warning

2 messages from 2013-10-06 to 2013-10-07. Participants: Ramsay Jones, Jeff King.
Thread: https://gitlist.dev/t/35072

## Ramsay Jones, 2013-10-06 20:48

Subject: [PATCH 1/6] config.c: Fix a sparse warning
Message-ID: <5251CC9D.9040309@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/5251CC9D.9040309%40ramsay1.demon.co.uk

```

Sparse issues an "'git_parse_unsigned' was not declared. Should it
be static?" warning. In order to suppress this warning, since this
symbol only requires file scope, we simply add the static modifier
to its declaration.

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

diff --git a/config.c b/config.c
index 6588cf5..e1d66a1 100644
--- a/config.c
+++ b/config.c
@@ -498,7 +498,7 @@ static int git_parse_signed(const char *value, intmax_t *ret, intmax_t max)
 	return 0;
 }
 
-int git_parse_unsigned(const char *value, uintmax_t *ret, uintmax_t max)
+static int git_parse_unsigned(const char *value, uintmax_t *ret, uintmax_t max)
 {
 	if (value && *value) {
 		char *end;
-- 
1.8.4

```

## Jeff King, 2013-10-07 11:31

Subject: Re: [PATCH 1/6] config.c: Fix a sparse warning
Message-ID: <20131007113135.GB5792@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20131007113135.GB5792%40sigill.intra.peff.net
In-Reply-To: <5251CC9D.9040309@ramsay1.demon.co.uk>

```
On Sun, Oct 06, 2013 at 09:48:29PM +0100, Ramsay Jones wrote:

> Sparse issues an "'git_parse_unsigned' was not declared. Should it
> be static?" warning. In order to suppress this warning, since this
> symbol only requires file scope, we simply add the static modifier
> to its declaration.

Thanks. This one is my fault. Commit 7192777 refactors git_parse_ulong,
which is public, into a more generic function. But since we kept the
git_parse_ulong wrapper, only that part needs to be public; nobody
outside the file calls the lower-level git_parse_unsigned.

-Peff

```
