From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4175 invoked by alias); 9 Jan 2009 09:57:26 -0000 Received: (qmail 4167 invoked by uid 22791); 9 Jan 2009 09:57:26 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Jan 2009 09:57:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C6C802A965A; Fri, 9 Jan 2009 04:57:12 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id p1KU7Jk1mW06; Fri, 9 Jan 2009 04:57:12 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id EB35E2A9657; Fri, 9 Jan 2009 04:57:11 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 1C93EE7ACD; Fri, 9 Jan 2009 13:57:05 +0400 (RET) Date: Fri, 09 Jan 2009 09:57:00 -0000 From: Joel Brobecker To: Kai Tietz Cc: Mark Kettenis , gdb-patches@sourceware.org Subject: Re: [RFC] convert a host address to a string Message-ID: <20090109095705.GA24105@adacore.com> References: <200901081618.n08GI4lw012422@brahms.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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/msg00178.txt.bz2 Kai, > > > Please be aware that %llx isn't valid for x86_64 windows (as it isn't > for > > > 32-bit standard). The options 'I' or 'I64' have to be used for > > > those targets (at least for _WIN64). > > > > Are you serious? Wow, that's unbelievable. %llx is defined by ISO > > C99, and you're saying that even the 64-bit editions of Windows that > > were introduced several years after the standard was ratified (and > > almost a decade after the first drafts were circulated) don't > > implement that bit of the standard? > > > > Sadly, yes. IIRC they implemented it in their newer runtimes, but it > didn't made it into msvcrt.dll even on 64-bit systems. I don't doubt that you are right, but I was wondering whether configure was (apparently incorrectly) defining PRINTF_HAS_LONG_LONG. | #include | | int | main (void) | { | long long addr = 0xdeadbeeffeedfaceLL; | | printf ("addr = 0x%llx.\n", addr); | return 0; | } I compiled the program above on our x86_64 Vista, and it compiled and worked like a charm. The check in configure is actually of the same nature. On 32bit systems: - XP: PRINTF_HAS_LONG_LONG is not defined. - Vista: All works fine. I don't have access to an x86_64 XP install, but I'm going to make a guess that PRINTF_HAS_LONG_LONG is not defined there. What I will do is send a patch that implements what Mark suggested. This should work on all our supported platforms, with the addition of x86_64 Vista, but to the exclusion of x86_64 XP. I am OK with the idea of adding a extra #if WIN64_ branch that allows us to build on x86_64 XP, but you'll have to convince others as well. -- Joel