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, 23 Apr 2008 07:52:13 -0400
- Subject: Re: [PATCH] long long for printf on MinGW
- References: <452CCE2D.8070806@st.com> <20061011130330.GA24187@nevyn.them.org> <452D09E8.5090005@st.com> <20080422180204.GA20664@caradoc.them.org> <480F0146.7090103@st.com>
On Wed, Apr 23, 2008 at 10:28:38AM +0100, Andrew STUBBS wrote:
> That said, selfishly speaking, it's overkill for _my_ problem, and I
> don't know of any other problems in this area - apart from hosts that
> just plain don't have long long, and you seem to suggest that gnulib
> won't solve that?
You can't pass a long long by C varargs if your compiler doesn't
support it, and GDB won't do anything sensible anyway - LONGEST
will be a long.
> Unless I'm mistaken, the code reserves enough space for every character
> to be in it's own nul-terminated substring, but since the minimum length
> %-spec is two characters, that's impossible. In this specific example,
> there would be 8 bytes reserved for the string "%lld" - enough for
> "%\0l\0l\0d\0", but "%I64d\0" only uses 6.
Right.
Go ahead with the patch. We can rip it out if we switch to gnulib's
printf.
--
Daniel Jacobowitz
CodeSourcery