{"thread":{"id":"19221","subject":"[PATCH] archive-tar.c: squelch a type mismatch warning","startedAt":"2009-05-07T08:08:19Z","lastAt":"2009-05-07T08:08:19Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"113179","messageId":"7vd4alfi8c.fsf@alter.siamese.dyndns.org","threadId":"19221","inReplyTo":null,"subject":"[PATCH] archive-tar.c: squelch a type mismatch warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-07T08:08:19Z","receivedAt":"2009-05-07T08:08:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On some systems, giving a value of type time_t to printf \"%lo\" that\nexpects an unsigned long would give a type mismatch warning.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * A fallout from my foray into FreeBSD (7.2) running on Linux kvm.  I was\n   a bit surprised to find that there only was this one, without saying \n   anything to NoThanks.\n\n archive-tar.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/archive-tar.c b/archive-tar.c\nindex ba890eb..cee06ce 100644\n--- a/archive-tar.c\n+++ b/archive-tar.c\n@@ -180,7 +180,7 @@ static int write_tar_entry(struct archiver_args *args,\n \n \tsprintf(header.mode, \"%07o\", mode & 07777);\n \tsprintf(header.size, \"%011lo\", S_ISREG(mode) ? size : 0);\n-\tsprintf(header.mtime, \"%011lo\", args->time);\n+\tsprintf(header.mtime, \"%011lo\", (unsigned long) args->time);\n \n \tsprintf(header.uid, \"%07o\", 0);\n \tsprintf(header.gid, \"%07o\", 0);\n"}]}