History

Small updates

Allow 'make speedtest' in tests directory Fix compiler warning tccpp.c

herman ten brugge committed 11 months ago

Commit 34eed881 parent 3c18df62 files · +4 −3Browse files

Unified · Split

2 files
  1. examples/ex3.c +2 −2
  2. tccpp.c +2 −1
examples/ex3.c+2−2
@@ -1,6 +1,6 @@
11 #include <tcclib.h>
22
3−int fib(n)
3+int fib(int n)
44 {
55 if (n <= 2)
66 return 1;
@@ -18,6 +18,6 @@ int main(int argc, char **argv) · 11 unmodified lines
1818 }
1919
2020 n = atoi(argv[1]);
21− printf("fib(%d) = %d\n", n, fib(n, 2));
21+ printf("fib(%d) = %d\n", n, fib(n));
2222 return 0;
2323 }
tccpp.c+2−1
@@ -2575,12 +2575,13 @@ static void parse_number(const char *p) · 2574 unmodified lines
25752575 if (t >= b)
25762576 tcc_error("invalid digit");
25772577 n = n * b + t;
2578− if (!ov)
2578+ if (!ov) {
25792579 /* detect overflow */
25802580 if (n1 >= 0x1000000000000000ULL && n / b != n1)
25812581 ov = 1;
25822582 else
25832583 n1 = n;
2584+ }
25842585 }
25852586 #ifdef TCC_CUT_ON_INTEGER_LITERAL_OVERFLOW
25862587 /* On integer literal overflow use the most significant digits before

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t