Skip to contentSkip to conversation

libelf: fix printing of pointers

PATCH In review Jan Beulich 2 participants 4 messages Jun 21, 2013 – Jun 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libelf: fix printing of pointers

Printing them as decimal number, the more with 0x prefix, is confusing and presumably relatively useless to most of us.

xen/include/xen/libelf.h +4 -4
@@ -82,13 +82,13 @@ typedef uintptr_t elf_ptrval;
   /* Provides a type declaration for a HANDLE. */
 
 #ifdef __XEN__
-# define ELF_PRPTRVAL "lu"
+# define ELF_PRPTRVAL "lx"
   /*
-   * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
-   * to "u", when in fact uintptr_t is an unsigned long.
+   * PRIxPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
+   * to "x", when in fact uintptr_t is an unsigned long.
    */
 #else
-# define ELF_PRPTRVAL PRIuPTR
+# define ELF_PRPTRVAL PRIxPTR
 #endif
   /* printf format a la PRId... for a PTRVAL */
 

libelf: fix printing of pointers

Printing them as decimal number, the more with 0x prefix, is confusing and presumably relatively useless to most of us.

xen/include/xen/libelf.h +4 -4
@@ -82,13 +82,13 @@ typedef uintptr_t elf_ptrval;
   /* Provides a type declaration for a HANDLE. */
 
 #ifdef __XEN__
-# define ELF_PRPTRVAL "lu"
+# define ELF_PRPTRVAL "lx"
   /*
-   * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
-   * to "u", when in fact uintptr_t is an unsigned long.
+   * PRIxPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
+   * to "x", when in fact uintptr_t is an unsigned long.
    */
 #else
-# define ELF_PRPTRVAL PRIuPTR
+# define ELF_PRPTRVAL PRIxPTR
 #endif
   /* printf format a la PRId... for a PTRVAL */
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw

Ping: [PATCH] libelf: fix printing of pointers

As fallout from the XSA-55 changes, I'd really like this to get into the tree even if mostly cosmetic.

Jan

Quoted 26 lines
Quoted 1 line
Quoted 1 line · Jan Beulich

Printing them as decimal number, the more with 0x prefix, is confusing and presumably relatively useless to most of us.

xen/include/xen/libelf.h +4 -4
@@ -82,13 +82,13 @@ typedef uintptr_t elf_ptrval;
   /* Provides a type declaration for a HANDLE. */
 
 #ifdef __XEN__
-# define ELF_PRPTRVAL "lu"
+# define ELF_PRPTRVAL "lx"
   /*
-   * PRIuPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
-   * to "u", when in fact uintptr_t is an unsigned long.
+   * PRIxPTR is misdefined in xen/include/xen/inttypes.h, on 32-bit,
+   * to "x", when in fact uintptr_t is an unsigned long.
    */
 #else
-# define ELF_PRPTRVAL PRIuPTR
+# define ELF_PRPTRVAL PRIxPTR
 #endif
   /* printf format a la PRId... for a PTRVAL */
 
#2 lore raw

Re: Ping: [PATCH] libelf: fix printing of pointers

Quoted 2 lines · Jan Beulich

As fallout from the XSA-55 changes, I'd really like this to get into the tree even if mostly cosmetic.

I applied, went to a meeting while it tested (along with some other changes) and I've just pushed.