Thread (4 messages) 4 messages, 2 authors, 2016-06-15

Re: [PATCH 1/2] t0006: test timezone parsing

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:05

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
quoted hunk
diff --git a/test-date.c b/test-date.c
index a9e705f..ac6854a 100644
--- a/test-date.c
+++ b/test-date.c
@@ -21,12 +21,15 @@ static void parse_dates(char **argv, struct timeval *now)
 	for (; *argv; argv++) {
 		char result[100];
 		time_t t;
+		int tz;
 
 		result[0] = 0;
 		parse_date(*argv, result, sizeof(result));
-		t = strtoul(result, NULL, 0);
-		printf("%s -> %s\n", *argv,
-			t ? show_date(t, 0, DATE_ISO8601) : "bad");
+		if (sscanf(result, "%ld %d", &t, &tz) == 2)
Gah...

On FreeBSD 8.0, we now see this.

   cc1: warnings being treated as errors
   test-date.c: In function 'parse_dates':
   test-date.c:28: warning: format '%ld' expects type 'long int *', but argument 3 has type 'time_t *'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help