From: Dan Magenheimer Subject: size_t and printk and Xen Date: Sat, 11 Oct 2008 07:05:34 -0700 (PDT) Message-ID: <1b70e8bc-7d46-4ad0-baad-9b9e985bf018@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org 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. http://www.velocityreviews.com/forums/t438359-portable-way-to-printf-a-size= t-instance.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? If it is not going to be removed, is there a workaround (other than ifdef'ing)? Thanks, Dan