aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-04-21 23:44:00 -0700
committerMichael Forney <mforney@mforney.org>2021-04-21 23:48:11 -0700
commitb4808867a2ede79b7c22823aaa75e388456b7b39 (patch)
treefb7b502d8ae320bbd1a7740d104cd635bee023cc
parentc5a570ee9bcf787bcaf639d4abb8c251ec223705 (diff)
qbe: Print floating point with DBL_DECIMAL_DIG precision
DECIMAL_DIG may vary from system to system depending on the width of long double, causing one of the tests to fail.
-rw-r--r--qbe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qbe.c b/qbe.c
index 1c4af9e..91b88fd 100644
--- a/qbe.c
+++ b/qbe.c
@@ -1039,7 +1039,7 @@ emitvalue(struct value *v)
switch (v->kind) {
case VALUE_CONST:
if (v->repr->base == 's' || v->repr->base == 'd')
- printf("%c_%.*g", v->repr->base, DECIMAL_DIG, v->f);
+ printf("%c_%.*g", v->repr->base, DBL_DECIMAL_DIG, v->f);
else
printf("%" PRIu64, v->i);
break;