From owner-freebsd-arch Tue Oct 8 17:26:59 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E6D537B401 for ; Tue, 8 Oct 2002 17:26:58 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B80B443E6A for ; Tue, 8 Oct 2002 17:26:57 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id UAA26465 for ; Tue, 8 Oct 2002 20:26:57 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g990QRE53055; Tue, 8 Oct 2002 20:26:27 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15779.30643.68675.577669@grasshopper.cs.duke.edu> Date: Tue, 8 Oct 2002 20:26:27 -0400 (EDT) To: freebsd-arch@freebsd.org Subject: lp64 vs lp32 printf X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG What's the accepted way to printf something (like sizeof()) which boils down to "unsigned int" on x86 and "unsigned long" on the LP64 platforms? I'm trying to fix alpha LINT, which so far is mosly stuff like: cc1: warnings being treated as errors ../../../dev/aic7xxx/aic79xx.c: In function `ahd_alloc': ../../../dev/aic7xxx/aic79xx.c:4208: warning: unsigned int format, different type arg (arg 3) ../../../dev/aic7xxx/aic79xx.c:4208: warning: unsigned int format, different type arg (arg 4) if ((ahd_debug & AHD_SHOW_MEMORY) != 0) { printf("%s: scb size = 0x%x, hscb size - 0x%x\n", ahd_name(ahd), sizeof(struct scb), sizeof(struct hardware_scb)); } I'm tempted to change the formats to 0x%lx and cast the args to (unsigned long) and be done with it. Is that correct? %j and uintmax_t? Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message