git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] config.c: Fix a sparse warning
@ 2013-10-06 20:48 Ramsay Jones
  2013-10-07 11:31 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2013-10-06 20:48 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: GIT Mailing-list


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

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

* Re: [PATCH 1/6] config.c: Fix a sparse warning
  2013-10-06 20:48 [PATCH 1/6] config.c: Fix a sparse warning Ramsay Jones
@ 2013-10-07 11:31 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2013-10-07 11:31 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Jonathan Nieder, GIT Mailing-list

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

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

end of thread, other threads:[~2013-10-07 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-06 20:48 [PATCH 1/6] config.c: Fix a sparse warning Ramsay Jones
2013-10-07 11:31 ` Jeff King

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