public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: long long conversion specifier
@ 2004-09-28 13:00 aimen bouchhima
  2004-09-28 21:37 ` Sisyphus
  0 siblings, 1 reply; 4+ messages in thread
From: aimen bouchhima @ 2004-09-28 13:00 UTC (permalink / raw)
  To: kalinabears; +Cc: gcc-help

On may 32-bit machine  -gcc version 3.3.2-
the following code 

#include <stdio.h>
int main()
{
	unsigned long long int x = 0x1000000000000001ULL;
	printf("size = %d , value = %llx  \n ",sizeof(x),x);
	return 1;
}

results in :
size = 8 , value = 1000000000000001



HTH

Aimen

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: long long conversion specifier
  2004-09-28 13:00 long long conversion specifier aimen bouchhima
@ 2004-09-28 21:37 ` Sisyphus
  2004-09-28 22:48   ` Sisyphus
  0 siblings, 1 reply; 4+ messages in thread
From: Sisyphus @ 2004-09-28 21:37 UTC (permalink / raw)
  Cc: gcc-help

aimen bouchhima wrote:
> On may 32-bit machine  -gcc version 3.3.2-
> the following code 
> 
> #include <stdio.h>
> int main()
> {
> 	unsigned long long int x = 0x1000000000000001ULL;
> 	printf("size = %d , value = %llx  \n ",sizeof(x),x);
> 	return 1;
> }
> 
> results in :
> size = 8 , value = 1000000000000001
> 

For me:
size = 8 , value = 1

gcc version 3.2.3 (mingw special 20030504-1)

Is that a MinGW bug or a gcc bug ?

Thanks aimen, m.

Cheers,
Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: long long conversion specifier
  2004-09-28 21:37 ` Sisyphus
@ 2004-09-28 22:48   ` Sisyphus
  0 siblings, 0 replies; 4+ messages in thread
From: Sisyphus @ 2004-09-28 22:48 UTC (permalink / raw)
  Cc: gcc-help

Sisyphus wrote:
> aimen bouchhima wrote:
> 
>> On may 32-bit machine  -gcc version 3.3.2-
>> the following code
>> #include <stdio.h>
>> int main()
>> {
>>     unsigned long long int x = 0x1000000000000001ULL;
>>     printf("size = %d , value = %llx  \n ",sizeof(x),x);
>>     return 1;
>> }
>>
>> results in :
>> size = 8 , value = 1000000000000001
>>
> 
> For me:
> size = 8 , value = 1
> 
> gcc version 3.2.3 (mingw special 20030504-1)
> 
> Is that a MinGW bug or a gcc bug ?
> 

Took a look on the MinGW users mailing list archive and found that the 
MSVC runtime's printf() doesn't know about 'll'.
The solution is to use 'I64' instead of 'll'.

Cheers,
Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* long long conversion specifier
@ 2004-09-28 12:29 Sisyphus
  0 siblings, 0 replies; 4+ messages in thread
From: Sisyphus @ 2004-09-28 12:29 UTC (permalink / raw)
  To: gcc

Hi,

On a 32 bit PC (Win32) what is the printf conversion specifier that I 
need to use in order to print out an unsigned 64 bit (long long) value ?

I can't believe the trouble I'm having in finding an answer ... I've 
found such things as 'llu', 'Lu', and 'l64u', but none of those work 
(either with or without a preceding '%') with my gcc (MinGW) compiler.

Also it would be really great if anyone can supply a weblink to a 
*complete* list of conversion specifiers.

Cheers,
Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-28 22:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-28 13:00 long long conversion specifier aimen bouchhima
2004-09-28 21:37 ` Sisyphus
2004-09-28 22:48   ` Sisyphus
  -- strict thread matches above, loose matches on Subject: below --
2004-09-28 12:29 Sisyphus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).