Thanks for this; I guess there isn't a portable way of doing this then that will work the same on non-msvcrt without #IFDEFs?

Regards

Paul
Sent via BlackBerry

-----Original Message-----
From: mingw-users-bounces@lists.sourceforge.net <mingw-users-bounces@lists.sourceforge.net>
To: MinGW Users List <mingw-users@lists.sourceforge.net>
Sent: Sat Mar 29 11:49:11 2008
Subject: Re: [Mingw-users] long long int printf query

Hi Paul,

On Sat, 29 Mar 2008, Paul Hargreaves wrote:

>   printf("o=901 %i\n", (o==901));
>   printf("i=902 %i\n", (i==902));
>   printf("a=903 %i\n", (a==903));
>   printf("Testing sizes o:%llu: i:%llu: a:%llu:\n", o, i, a);
>   return 0;
[...]
> Compile this using gcc in mingw and you get the following odd results:
>
> o=901 1
> i=902 1
> a=903 1
> Testing sizes o:901: i:0: a:902:

You have to use %I64u as the format string for Microsoft's libc (msvcrt).

Cheers, Chris.
--
_____ __     _
\  __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\ _/_/_/_//_/___/ | We are GNU : free your mind & your software |

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Confidentiality Notice: This e-mail message, including any attachment is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.