From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 18 18:04:32 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA5AB1065675 for ; Thu, 18 Sep 2008 18:04:32 +0000 (UTC) (envelope-from bahamasfranks@gmail.com) Received: from mail-gx0-f17.google.com (mail-gx0-f17.google.com [209.85.217.17]) by mx1.freebsd.org (Postfix) with ESMTP id 630CF8FC1F for ; Thu, 18 Sep 2008 18:04:32 +0000 (UTC) (envelope-from bahamasfranks@gmail.com) Received: by gxk10 with SMTP id 10so29420393gxk.19 for ; Thu, 18 Sep 2008 11:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; bh=rNPaj1qRm/Ee6Hswu9vSVdwLI8woRaKDBAE9AH/BDFQ=; b=nv5wkFhUdBdHpFlvhb6TmPpYZo9J+V/yJBlHawg+cm+GcJCHT77utNS8eZpP260zil /KE3guoT2KpO0YoB11boIaqWuFNd/tSbNlUxCAzQ3FFhHeB0ZcfVKWeiWaRS4JLpSeOw g1a1PWAlYsWy7tu0ZP5MLyWfy34wqKb5KC2Y8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:mime-version :content-type:content-transfer-encoding:content-disposition :x-google-sender-auth; b=tUCt0kycrh+e2B+gCrURC1vDsp5xGEJe7pTDxDNM253hYp9DgMO/mJaVFrqTTB6zYR w8Ub2pomKU65IYjOC1OAa3i6JoGaFIDg4yM2Q1R+1kxYqBocvFe0UzEvon0ybcvxmNS2 wzTHWRPzJsmFHs505HErFfcl/nrnZVIufOpT8= Received: by 10.142.246.19 with SMTP id t19mr1533505wfh.55.1221759703012; Thu, 18 Sep 2008 10:41:43 -0700 (PDT) Received: by 10.142.141.5 with HTTP; Thu, 18 Sep 2008 10:41:42 -0700 (PDT) Message-ID: <539c60b90809181041n658d2823y89e42bb0ccfa6d06@mail.gmail.com> Date: Thu, 18 Sep 2008 10:41:42 -0700 From: "Steve Franks" Sender: bahamasfranks@gmail.com To: freebsd-hackers MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 3a05f32e12037c83 Subject: proper types for printf()-ing pointers on amd64 that won't break i386? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: stevefranks@ieee.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 18:04:32 -0000 Hi, I'm trying to correct some warnings in a port marked ONLY_FOR_ARCHS=i386. They stem from casting a pointer (which I assume is a 64-bit unsigned) to "unsigned int" which is apparently 32 bits? I sort of thought int was supposed to be the atomic register size, but no doubt that would break more than it would help, so it's 32-bits. Anyways, what's the right way to fix this? The port actually works fine as-is on amd64, so I can only assume something was fixed for 7.1, or someone was being extra cautious with the i386 tag. The code: typedef unsigned int cardinal; ... fprintf(stderr, "Mode Table Offset: $C0000 + $%x\n", ((cardinal)map->mode_table) - ((cardinal)map->bios_ptr)); Can I just ditch the cast+%x and use %p? I don't have an i386 system to test on, and I don't want to break anything if I submit a patch... Thanks, Steve