[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Wrong __int64 computation
From: |
Christian Jullien |
Subject: |
[Tinycc-devel] Wrong __int64 computation |
Date: |
Fri, 18 Dec 2009 12:18:02 +0100 |
Here is a simple test case that shows the bug:
#include <stdio.h>
int
main()
{
int i = 16;
__int64 j = 16;
unsigned __int64 n;
// Use %p to show all bits
n = 0x7fffffffffff;
printf("Init: n=%p, sizeof(n) = %d\n", n, sizeof(n)); // == 8 Ok!
n = 0x7fffffffffff;
n = n / i; // i is an int
printf("Wrong: n=%p\n", n);
n = 0x7fffffffffff;
n = n / j; // j is an __int64
printf("Wrong: n=%p\n", n);
n = 0x7fffffffffff;
n = n / 16;
printf("Good: n=%p\n", n);
}
- [Tinycc-devel] Understanding tcc Makefile, k1w1, 2009/12/05
- Re: [Tinycc-devel] Understanding tcc Makefile, grischka, 2009/12/06
- [Tinycc-devel] 64bits - Wrong comparison between pointer and long cste, Christian Jullien, 2009/12/07
- Re: [Tinycc-devel] 64bits - Wrong comparison between pointer and long cste, grischka, 2009/12/07
- RE: [Tinycc-devel] 64bits - Wrong comparison between pointer andlong cste, Christian Jullien, 2009/12/08
- RE: [Tinycc-devel] 64bits - Wrong comparison between pointerandlong cste, Christian Jullien, 2009/12/08
- RE: [Tinycc-devel] 64bits - Wrong comparison betweenpointerandlong cste, Christian Jullien, 2009/12/08
- [Tinycc-devel] longjmp not working on 64bit, Christian Jullien, 2009/12/11
- Re: [Tinycc-devel] longjmp not working on 64bit, grischka, 2009/12/17
- RE: [Tinycc-devel] longjmp not working on 64bit, Christian Jullien, 2009/12/18
- [Tinycc-devel] Wrong __int64 computation,
Christian Jullien <=
- RE: [Tinycc-devel] Wrong __int64 computation, Christian Jullien, 2009/12/19
- Re: [Tinycc-devel] Wrong __int64 computation, grischka, 2009/12/19
- RE: [Tinycc-devel] Wrong __int64 computation, Christian Jullien, 2009/12/20
Re: [Tinycc-devel] Understanding tcc Makefile, k1w1, 2009/12/07