This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] long long for printf on MinGW
- From: Daniel Jacobowitz <drow at false dot org>
- To: Andrew STUBBS <andrew dot stubbs at st dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Wed, 11 Oct 2006 09:03:31 -0400
- Subject: Re: [PATCH] long long for printf on MinGW
- References: <452CCE2D.8070806@st.com>
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