tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Possible bug in printf() using long long


From: asaf gil
Subject: [Tinycc-devel] Possible bug in printf() using long long
Date: Sun, 12 Aug 2012 18:03:54 +0200

 (tcc 0.9.25 under windows)
------------------------------------------------------
long long a,b;
double c = 2.1;
a=50;
b=100;

printf("a = %lld \n", a);
printf("b = %lld \n", b);
printf("a = %lld, b = %lld \n", a, b);
printf("c = %f, a = %lld, b = %lld  c: %f\n", c, a, b, c);

Output:
a = 50
b = 100
a = 50, b = 0
c = 2.100000, a = 50, b =  0,  c = 0.000000
------------------------------------------------------------
long long a,b, c;
a=50;
b=100;
c = 0;
printf("a = %lld, b = %lld, c = %lld\n", a, b, c);

Output:
a = 50, b = 0, c = 100
-------------------------------------------------------------------

In the first example printf() reports zero values for every variable in format string after the first 'long long'.
In the 2nd example printf() seems to print the values in 'delayed' fashion... i.e. c is reported having the value of b.

Regards,

Asaf

reply via email to

[Prev in Thread] Current Thread [Next in Thread]