[PATCH] long long for printf on MinGW
Daniel Jacobowitz
drow@false.org
Wed Apr 23 12:18:00 GMT 2008
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
More information about the Gdb-patches
mailing list