This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17499] long long constant broken
- From: "pyrodave at msn dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2004 18:09:47 -0000
- Subject: [Bug c++/17499] long long constant broken
- References: <20040915105459.17499.L.Gregory@Surrey.ac.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pyrodave at msn dot com 2004-09-17 18:09 -------
> gcc-3.3.4 gives the following warning:-
> "integer constant is too large for its type".
> and gives "value is 0" as its output.
>
> gcc-3.3.3 gives no such warning and gives :
> " value is 8000000000000" as its answer.
I just found this bug report while researching a problem I was having.
using gcc-3.2.2 the following code:
#include <stdio.h>
typedef unsigned long long USB64;
unsigned long long zz;
int main()
{
zz = 10293847561029384756;
char aa[20];
sprintf(aa , "%20.20d" , zz);
printf("%s\n",aa);
}
generated the warning "Decimal constant is so large it is unsigned" and
compiled, but when ran, the result is 00000000001328380468.
When I changed it to add the ULL at the end of the constant, the warning
disappeared but the result was the same.
I just installed gcc-3.3.4-20040914 and got exactly the same results.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17499