aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-11-25 11:25:04 +0800
committerThomas Preud'homme <robotux@celest.fr>2013-11-25 11:25:04 +0800
commit5919da6f05a225907a54f239a725e67c7989a2a0 (patch)
treeca7d96fadfadbfd5cbcb8acf7fb8fbee9913917c /tests
parent4260ce1889f6f0f2fe25f4c783dae2b23a4a0021 (diff)
downloadtinycc-5919da6f05a225907a54f239a725e67c7989a2a0.tar.gz
tinycc-5919da6f05a225907a54f239a725e67c7989a2a0.tar.bz2
Make abitest.c have predictable result
stdarg_test in abitest.c relies on a sum of some parameters made by both the caller and the callee to reach the same result. However, the variables used to store the temporary result of the additions are not initialized to 0, leading to uncertainty as to the results. This commit add this needed initialization.
Diffstat (limited to 'tests')
-rw-r--r--tests/abitest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/abitest.c b/tests/abitest.c
index 7b12144..d3e151f 100644
--- a/tests/abitest.c
+++ b/tests/abitest.c
@@ -339,8 +339,8 @@ static int stdarg_test(void) {
"#include <stdarg.h>\n"
"typedef struct {long long a, b, c;} stdarg_test_struct_type;\n"
"void f(int n_int, int n_float, int n_struct, ...) {\n"
- " int i, ti;\n"
- " double td;\n"
+ " int i, ti = 0;\n"
+ " double td = 0.0;\n"
" stdarg_test_struct_type ts = {0,0,0}, tmp;\n"
" va_list ap;\n"
" va_start(ap, n_struct);\n"