Pointer representation in the server

Adam Jackson ajax at nwnk.net
Wed Jan 12 14:59:24 PST 2005


Is there any objection to requiring that printf support the %p modifier?  
There are quite a few places in the server where we use 0x%08lx to print 
pointer values, which is both harder to read than %p and wrong for LP64 
systems.  We do use %p in several places as well, so this is really more of a 
cleanup than a policy decision.

From a quick look, %p is supported on linux, solaris, and freebsd (and 
probably all the other BSDs as well including OS X), mingw would be the only 
unknown.

Also, what's the recommended type for host addresses?  The 'pointer' type is 
an alias for void*, which would expand to the right size on all systems; 
presumably if you want to do anything with the data at that address you'll 
cast it to something else first.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20050112/9afbd8db/attachment.pgp>


More information about the xorg mailing list