printf and the long long case

Mike McCormack mike at
Tue Feb 15 03:03:11 CST 2005

Jesse Allen wrote:
> Since Mike McCormack's printf patch has our own vsnprintf parsing the
> format strings, but yet we still push integers to libc's printf, I
> figured that we can handle the 'I' (eye) size type now.  I hacked
> together a patch that handles it and fixes 3 test failures with long
> long.  It fixes it by converting I (eye) and I32 to long, and I64 to
> long long.  'll'  (ell ell) is translated to be long only.
> Mike, I have a question.  You have flags.IntegerDouble++; on the case
> of long long -- what were you planning on doing with it?  Other than
> that it is unused.  I decided to use it as the flag for long long.
> Patch below.

Hi Jesse,

You're correct I didn't handle the IntegerDouble case... that needs to 
be fixed.  The %e format also returns the wrong thing.

I'm not sure if you patch is correct or not.  You should write as least 
a few test cases to show how %I works and how %I64d.  Things to test 
would be %Ix %Is %I1d %I0d %Iz %I64ld etc.  Once you're clear where the 
%I should be handled, it should be easier to write the code.

I have an MSVC 6 project set up for testing sprintf.  If you'd like to 
use that, mail me and I'll send it to you.


More information about the wine-devel mailing list