From owner-freebsd-audit Sun Feb 2 12:36:37 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB92F37B401 for ; Sun, 2 Feb 2003 12:36:35 -0800 (PST) Received: from numeri.campus.luth.se (numeri.campus.luth.se [130.240.197.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFEDF43F3F for ; Sun, 2 Feb 2003 12:36:34 -0800 (PST) (envelope-from k@numeri.campus.luth.se) Received: from numeri.campus.luth.se (localhost [127.0.0.1]) by numeri.campus.luth.se (8.12.6/8.12.6) with ESMTP id h12KaRBC038590 for ; Sun, 2 Feb 2003 21:36:27 +0100 (CET) (envelope-from k@numeri.campus.luth.se) Received: (from k@localhost) by numeri.campus.luth.se (8.12.6/8.12.6/Submit) id h12KaRNo038589 for audit@freebsd.org; Sun, 2 Feb 2003 21:36:27 +0100 (CET) Date: Sun, 2 Feb 2003 21:36:26 +0100 From: Johan Karlsson To: FreeBSD-audit Subject: using 'PRIu64' from to get rid of warnings Message-ID: <20030202203626.GC759@numeri.campus.luth.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi is this the correct way to remove warning in printf statements? Index: camcontrol.c =================================================================== RCS file: /home/ncvs/src/sbin/camcontrol/camcontrol.c,v retrieving revision 1.48 diff -u -r1.48 camcontrol.c --- camcontrol.c 17 Dec 2002 06:05:21 -0000 1.48 +++ camcontrol.c 2 Feb 2003 19:00:52 -0000 @@ -30,6 +30,8 @@ #include #include + +#include #include #include #include @@ -3086,7 +3088,8 @@ percentage = 10000 * val; fprintf(stdout, - "\rFormatting: %qd.%02qd %% " + "\rFormatting: " + "%"PRIu64".%02"PRIu64" %% " "(%d/%d) done", percentage / (0x10000 * 100), (percentage / 0x10000) % 100, The warnings are /usr/src/sbin/camcontrol/camcontrol.c: In function `scsiformat': /usr/src/sbin/camcontrol/camcontrol.c:3082: warning: long long int format, u_int64_t arg (arg 3) /usr/src/sbin/camcontrol/camcontrol.c:3082: warning: long long int format, u_int64_t arg (arg 4) Are the PRIu64 et al documented somewhere? /Johan K -- Johan Karlsson mailto:johan@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message