From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14573 invoked by alias); 11 Oct 2006 13:03:40 -0000 Received: (qmail 14561 invoked by uid 22791); 11 Oct 2006 13:03:39 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 11 Oct 2006 13:03:34 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GXdkB-0006PX-Ee; Wed, 11 Oct 2006 09:03:31 -0400 Date: Wed, 11 Oct 2006 13:03:00 -0000 From: Daniel Jacobowitz To: Andrew STUBBS Cc: GDB Patches Subject: Re: [PATCH] long long for printf on MinGW Message-ID: <20061011130330.GA24187@nevyn.them.org> Mail-Followup-To: Andrew STUBBS , GDB Patches References: <452CCE2D.8070806@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <452CCE2D.8070806@st.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00106.txt.bz2 On Wed, Oct 11, 2006 at 11:57:49AM +0100, Andrew STUBBS wrote: > Hi, > > Windows/MinGW printf does support printing of long long types, but it > does not do using %lld etc. > > This patch converts %ll (or %...ll) to %I64 as required by Windows. > > GDB printf still won't accept I64 as input, but then this is not > standard compliant so I don't think it really should. > > :ADDPATCH printcmd.c: > > Andrew Stubbs I don't much like #ifdef __MINGW32__, but I'm not sure what else to do about it... I suppose we could autoconf for inttypes.h and check for PRIx64 starting with 'I', but that's no better. Could you at least do something like this? #if defined(__MINGW32__) # define USE_PRINTF_I64 1 # define PRINTF_HAS_LONG_LONG #else # define USE_PRINTF_I64 0 #endif if (lcount > 1 && USE_PRINTF_I64) The GCC folks learned a hard lesson that conditionally compiled code is a maintenance burden all its own. Thanks in advance. -- Daniel Jacobowitz CodeSourcery