This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Use %p conversion specifier to fix hppa compiler warning


> Date: Sun, 12 Jun 2005 23:02:15 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> 
> Currently the compiler warns about hppa_pointer_to_address_hack().
> Rather than adding ugly casts and making this an even worse hack, I
> propose to remove it completely in favour of using the %p format
> specifier.
> 
> In the past we didn't use the %p conversion specifier since it wasn't
> portable; ancient UNIX didn't support it.  However, I'm confident that
> we do not support those systems any more.  I've done some archeology,
> and it seems %p is supported by Ultrix 4.0, HP-UX 10.01 and SunOS
> 4.1.3.

%p is ANSI/ISO C89, IIRC, so we can use it freely.  The one problem
with it is that its results are inconsistent: some libraries produce
"0x" before the address, others don't.  This is a minor inconsistency,
but with some numerical values, if you don't have the telltale "0x",
you may wonder whether the number is in hex or decimal.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]