Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 1999 17:38:49 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        mjacob@feral.com
Cc:        freebsd-alpha@FreeBSD.ORG
Subject:   Re: printing vm_offset_t's
Message-ID:  <13977.11142.915199.277600@grasshopper.cs.duke.edu>
In-Reply-To: <Pine.LNX.4.04.9901101432120.14308-100000@feral-gw>
References:  <199901102154.QAA72227@grasshopper.cs.duke.edu> <Pine.LNX.4.04.9901101432120.14308-100000@feral-gw>

next in thread | previous in thread | raw e-mail | index | archive | help

Matthew Jacob writes:
 > 
 > Hmm. How about %p?

That's another option, but unless you cast the arg to a pointer (like
void *), you get

	 warning: format argument is not a pointer (arg 4)

Drew


 > On Sun, 10 Jan 1999, Andrew Gallatin wrote:
 > 
 > > 
 > > What's the proper way to print out vm_offset_t's in MI parts of the
 > > kernel?
 > > 
 > > Certain things (like procfs's map file) are broken because i386
 > > defines vm_offset_t as:
 > > 
 > > /sys/i386/include/types.h:typedef       unsigned int    vm_offset_t;
 > > 	
 > > 	but alpha defines it as:
 > > 
 > > /sys/alpha/include/types.h:typedef      unsigned long   vm_offset_t;
 > > 
 > > And printf format strings for printing out vm_offset_t's are typically 
 > > "0x%x" which results in warnings on alpha, as well as truncation of
 > > the data.
 > > 
 > > My gut reaction is that the i386's definition should be changed to
 > > an unsigned long (since the size would be the same) & all format
 > > strings for printing out vm_offset_t's should be changed to "0x%lx"
 > > 
 > > If that's too radical, I think that at the very least format strings
 > > should be changed to "0x%lx".  This would result in proper behaviour
 > > on alphas, with the downside of also shifting warning to the i386
 > > branch.
 > > 
 > > Or maybe we should just cast vm_offset_t's to (void *) and use a %p
 > > format sting.
 > > 
 > > Just wanted to raise the issue..
 > > 
 > > Drew
 > > 
 > > ------------------------------------------------------------------------------
 > > Andrew Gallatin, Sr Systems Programmer	http://www.cs.duke.edu/~gallatin
 > > Duke University				Email: gallatin@cs.duke.edu
 > > Department of Computer Science		Phone: (919) 660-6590
 > > 
 > > 
 > > 
 > > 
 > > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > > with "unsubscribe freebsd-alpha" in the body of the message
 > > 
 > 
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-alpha" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13977.11142.915199.277600>