From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26665 invoked by alias); 13 Jun 2005 06:12:11 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26649 invoked by uid 22791); 13 Jun 2005 06:12:07 -0000 Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 13 Jun 2005 06:12:07 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-83-251.inter.net.il [80.230.83.251]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id BMY16400 (AUTH halo1); Mon, 13 Jun 2005 09:12:03 +0300 (IDT) Date: Mon, 13 Jun 2005 06:12:00 -0000 Message-Id: From: Eli Zaretskii To: Mark Kettenis CC: gdb-patches@sources.redhat.com In-reply-to: <200506122102.j5CL2FPB002032@elgar.sibelius.xs4all.nl> (message from Mark Kettenis on Sun, 12 Jun 2005 23:02:15 +0200 (CEST)) Subject: Re: [RFC] Use %p conversion specifier to fix hppa compiler warning Reply-to: Eli Zaretskii References: <200506122102.j5CL2FPB002032@elgar.sibelius.xs4all.nl> X-SW-Source: 2005-06/txt/msg00150.txt.bz2 > Date: Sun, 12 Jun 2005 23:02:15 +0200 (CEST) > From: Mark Kettenis > > 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.