diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2013-11-25 11:25:04 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2013-11-25 11:25:04 +0800 |
| commit | 5919da6f05a225907a54f239a725e67c7989a2a0 (patch) | |
| tree | ca7d96fadfadbfd5cbcb8acf7fb8fbee9913917c /tests/abitest.c | |
| parent | 4260ce1889f6f0f2fe25f4c783dae2b23a4a0021 (diff) | |
| download | tinycc-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/abitest.c')
| -rw-r--r-- | tests/abitest.c | 4 |
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" |
