git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fast-import.c: Silence build warning
@ 2009-08-31 11:21 Michael Wookey
  2009-08-31 12:29 ` Sverre Rabbelier
  2009-08-31 23:42 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Wookey @ 2009-08-31 11:21 UTC (permalink / raw)
  To: git

gcc 4.3.3 (Ubuntu 9.04) warns that the return value of strtoul() was not
checked by issuing the following notice:

  warning: ignoring return value of ‘strtoul’, declared with attribute
warn_unused_result

Provide a dummy variable to keep the compiler happy.

Signed-off-by: Michael Wookey <michaelwookey@gmail.com>
---
 fast-import.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fast-import.c b/fast-import.c
index 7ef9865..1386e75 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1744,10 +1744,11 @@ static int validate_raw_date(const char *src,
char *result, int maxlen)
 {
 	const char *orig_src = src;
 	char *endp;
+	unsigned long int unused;

 	errno = 0;

-	strtoul(src, &endp, 10);
+	unused = strtoul(src, &endp, 10);
 	if (errno || endp == src || *endp != ' ')
 		return -1;

@@ -1755,7 +1756,7 @@ static int validate_raw_date(const char *src,
char *result, int maxlen)
 	if (*src != '-' && *src != '+')
 		return -1;

-	strtoul(src + 1, &endp, 10);
+	unused = strtoul(src + 1, &endp, 10);
 	if (errno || endp == src || *endp || (endp - orig_src) >= maxlen)
 		return -1;

-- 
1.6.4.2.236.gf324c

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

end of thread, other threads:[~2009-09-01  6:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-31 11:21 [PATCH] fast-import.c: Silence build warning Michael Wookey
2009-08-31 12:29 ` Sverre Rabbelier
2009-08-31 21:27   ` Alex Riesen
2009-08-31 21:42     ` Sverre Rabbelier
2009-08-31 23:31     ` Michael Wookey
2009-08-31 23:42 ` Junio C Hamano
2009-08-31 23:55   ` Michael Wookey
2009-09-01  4:06     ` Stephen Boyd
2009-09-01  6:30     ` Alex Riesen

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