From patchwork Wed Nov 26 22:47:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 3961 Received: (qmail 758 invoked by alias); 26 Nov 2014 22:47:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 744 invoked by uid 89); 26 Nov 2014 22:47:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Wed, 26 Nov 2014 22:47:33 +0000 From: Joseph Myers To: Subject: Fix nss/tst-nss-test1.c format warning Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Testing for 32-bit x86 shows up a warning "tst-nss-test1.c:25:3: warning: format '%ju' expects argument of type 'uintmax_t', but argument 2 has type 'int' [-Wformat=]". The argument is a difference of two pointers, a signed quantity of type ptrdiff_t for which the right format is %td; this patch makes this test use that format. Tested for 32-bit x86. 2014-11-26 Joseph Myers * nss/tst-nss-test1.c (do_test): Use %td printf format for pointer difference, not %ju. diff --git a/nss/tst-nss-test1.c b/nss/tst-nss-test1.c index 4e443d4..c5750e0 100644 --- a/nss/tst-nss-test1.c +++ b/nss/tst-nss-test1.c @@ -21,7 +21,7 @@ do_test (void) if (p->pw_uid != *np || strncmp (p->pw_name, "name", 4) != 0 || atol (p->pw_name + 4) != *np) { - printf ("passwd entry %ju wrong (%s, %u)\n", + printf ("passwd entry %td wrong (%s, %u)\n", np - pwdids, p->pw_name, p->pw_uid); retval = 1; break;