mirror of
https://github.com/TinyCC/tinycc.git
synced 2026-02-06 13:51:36 +00:00
Small updates
Allow 'make speedtest' in tests directory Fix compiler warning tccpp.c
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include <tcclib.h>
|
||||
|
||||
int fib(n)
|
||||
int fib(int n)
|
||||
{
|
||||
if (n <= 2)
|
||||
return 1;
|
||||
@@ -18,6 +18,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
n = atoi(argv[1]);
|
||||
printf("fib(%d) = %d\n", n, fib(n, 2));
|
||||
printf("fib(%d) = %d\n", n, fib(n));
|
||||
return 0;
|
||||
}
|
||||
|
||||
3
tccpp.c
3
tccpp.c
@@ -2575,12 +2575,13 @@ static void parse_number(const char *p)
|
||||
if (t >= b)
|
||||
tcc_error("invalid digit");
|
||||
n = n * b + t;
|
||||
if (!ov)
|
||||
if (!ov) {
|
||||
/* detect overflow */
|
||||
if (n1 >= 0x1000000000000000ULL && n / b != n1)
|
||||
ov = 1;
|
||||
else
|
||||
n1 = n;
|
||||
}
|
||||
}
|
||||
#ifdef TCC_CUT_ON_INTEGER_LITERAL_OVERFLOW
|
||||
/* On integer literal overflow use the most significant digits before
|
||||
|
||||
Reference in New Issue
Block a user