2011/12/17 Ozkan Sezer <[email protected]>:
> On Sat, Dec 17, 2011 at 6:09 PM, David Cleaver <[email protected]> wrote:
>>
>>
>> On 12/17/2011 9:24 AM, Ozkan Sezer wrote:
>>> On Sat, Dec 17, 2011 at 4:49 PM, David Cleaver  wrote:
>>>> Hello Everyone,
>>>>
>>>> I seem to have run into an issue with printf with my native toolchain that
>>>> someone else with the cross-compiler does not have.  I was hoping someone 
>>>> here
>>>> could help us track down what might be the difference between our two 
>>>> builds.
>>>>
>>>> We ran tests based off of the following test program:
>>>> #include<stdio.h>
>>>> #include<inttypes.h>
>>>>
>>>> int main(void) {
>>>> uintmax_t x = 1125899906842749LL;
>>>> printf("%llu\n", x);
>>>
>>> %ll isn't supported by printf family from msvcrt.dll, so try
>>> defining __USE_MINGW_ANSI_STDIO=1 and recompile so
>>> that your code uses __mingw_printf()&  co.
>>
>> I know that putting
>> #define __USE_MINGW_ANSI_STDIO 1
>> at the top of the code will allow my build to be able to use %llu to print 
>> the
>> 64-bit variable.  However, I'm wondering why his compiler warns about the
>> unknown llu modifier, but still prints the full 64-bit value.
>
> I don't have an answer for that,

The ll width specifier isn't supported by all msvcrt version.
Equivalent for target would be I64.  Beginning with OS Vista (IIRC)
the msvcrt printf/scanf faimily routines are supporting ll, too.  But
to avoid breakage with older msvcrt, gcc has to warn about it.

>>   How can we track
>> down why it works for him, but not for me?
>
> First step would be making _sure_ that he isn't accidentally
> using the __mingw_* variant by looking at the preprocessed source
> (the -E switch of gcc).  If he really isn't, then I don't know:  Kai?

See msvcrt.dll's version.  It is related to it.

Regards,
Kai

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to