Small updates

Allow 'make speedtest' in tests directory
Fix compiler warning tccpp.c
This commit is contained in:
herman ten brugge
2025-12-17 20:22:08 +01:00
parent 3c18df610d
commit 34eed88a70
2 changed files with 4 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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