From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8433 invoked by alias); 9 Jan 2009 10:05:20 -0000 Received: (qmail 8424 invoked by uid 22791); 9 Jan 2009 10:05:19 -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; Fri, 09 Jan 2009 10:05:06 +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 n09A4wTV022538; Fri, 9 Jan 2009 11:05:03 +0100 In-Reply-To: <20090109095705.GA24105@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: Fri, 09 Jan 2009 10:05: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/msg00179.txt.bz2 Joel, Joel Brobecker wrote on 09.01.2009 10:57:05: > 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. That makes sense. I use at work XP64, and there is for sure no '%llx' support. I will cross check this this evening at home on Vista64. The bad thing here is if you would enable -Wformat, you get by gcc a warning about the double-(el)l ... Cheers, Kai | (\_/) This is Bunny. Copy and paste Bunny | (='.'=) into your signature to help him gain | (")_(") world domination.