[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] size_t and printk and Xen

  • To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Sun, 12 Oct 2008 10:22:43 +0100
  • Cc:
  • Delivery-date: Sun, 12 Oct 2008 02:22:55 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcksTBSCUy+siZg/Ed22twAWy6hiGQ==
  • Thread-topic: [Xen-devel] size_t and printk and Xen

On 11/10/08 15:05, "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx> wrote:

> I am adding code in Xen that printk's a size_t and find that
> I can't write code (short of ifdef'ing) that compiles on
> both 32-bit and 64-bit because size_t is typedef'd in Xen as an
> unsigned long.  C.f.

Cast to an int or to a long? Use %z?

> http://www.velocityreviews.com/forums/t438359-portable-way-to-printf-a-sizet-i
> nstance.html
> It appears that the %z format is understood by Xen printk.
> Is the typedef historical and should be removed?  Or is it
> necessary for some (older?) compilers?

Removing it would break the build, I think.

 -- Keir

> If it is not going to be removed, is there a workaround
> (other than ifdef'ing)?

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.