mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
598134fff6
The incr_offset offset code was not working with bounds checking. So I reverted part of tccgen.c. See new test code 132. Also added some debugging code that prints location of bounds checking calls. Needed this to find the problem. See lib/bcheck.c, lib/bt-dll.c, lib/bt-exe.c, lib/bt-log.c, tccrun.c
30 lines
396 B
C
30 lines
396 B
C
#include <stdio.h>
|
|
#include <float.h>
|
|
|
|
union ieee_double_extract
|
|
{
|
|
struct {
|
|
unsigned int manl:32;
|
|
unsigned int manh:20;
|
|
unsigned int exp:11;
|
|
unsigned int sig:1;
|
|
} s;
|
|
double d;
|
|
};
|
|
|
|
double scale(double d)
|
|
{
|
|
union ieee_double_extract x;
|
|
|
|
x.d = d;
|
|
x.d *= 1000;
|
|
return x.d;
|
|
}
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
printf("%g\n", scale(42));
|
|
return 0;
|
|
}
|