From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26973 invoked by alias); 8 Jan 2009 11:31:01 -0000 Received: (qmail 26964 invoked by uid 22791); 8 Jan 2009 11:31:00 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jan 2009 11:30:55 +0000 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.14.3/8.13.7/ROSCH/DDB) with ESMTP id n08BUjqU031283; Thu, 8 Jan 2009 12:30:50 +0100 In-Reply-To: <20090108112448.GU3664@adacore.com> To: Joel Brobecker Cc: gdb-patches@sourceware.org, Mark Kettenis Subject: Re: [RFC] convert a host address to a string MIME-Version: 1.0 Message-ID: From: Kai Tietz Date: Thu, 08 Jan 2009 11:31:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00147.txt.bz2 Hi Joel, gdb-patches-owner@sourceware.org wrote on 08.01.2009 12:24:48: > > By it you can use standard ISO type intptr_t. And I missed to add > > inttypes.h. > > By this you could simply use PRIXPTR for printing hex pointer failues. > > > > E.g. > > fprint (fp, "0x%" PRIXPTR, (intptr_t) address); > > That's pretty clever. Bad luck for us, however. The MinGW inttypes.h > defines PRIxPTR as "I64x". When I tried with an example, I got a warning > because intptr_t is "long long int" whereas "%I64x" requires an unsigned > int. Changing the cast to uintptr_t helps a little, but it's not enough > since "unsigned int" is definitely not large enough to hold a pointer! > > I really should report that to the MinGW guys! Ok, I got it. But there is not much to do here. I am a bit curious about that x wants an unsigned scalar. I have to verify this. The alternative for this, would be to cast to size_t in general. Cheers, Kai | (\_/) This is Bunny. Copy and paste Bunny | (='.'=) into your signature to help him gain | (")_(") world domination.