commit 6ad775491d80225ba2535288259fbd92d42ba103
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Fri Apr 15 01:04:44 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Fri Apr 15 01:04:44 2016 +0200
[cc1 - cc2] Fix several errors in printf formats
We have to be careful that target dependant sizes must be printed
always with lld, because iin this way we can be sure it will be correct
always.
diff --git a/cc1/code.c b/cc1/code.c
index e9f1698..5ee78b5 100644
--- a/cc1/code.c
+++ b/cc1/code.c
@@ -258,7 +258,8 @@ emittype(Type *tp)
emitletter(tp);
putchar('\t');
emitletter(tp->type);
- printf("\t#%c%d\n", sizettype->letter, tp->n.elem);
+ printf("\t#%c%lld\n",
+ sizettype->letter, (long long) tp->n.elem);
return;
case PTR:
emittype(tp->type);
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index 020e2c6..905325f 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -201,8 +201,9 @@ writeout(void)
for ( ; p; p = p->next) {
tp = &p->type;
- printf("\t%s %s= alloc%d %d\n",
- symname(p), size2asm(tp), tp->size, tp->align);
+ printf("\t%s %s= alloc%lld %lld\n",
+ symname(p), size2asm(tp),
+ (long long) tp->size, (long long) tp->align);
}
for (pc = prog; pc; pc = pc->next) {
@@ -233,6 +234,7 @@ inst3(void)
{
printf("\t%s %c= %s\t%s,%s\n",
addr2txt(&pc->to),
+ 'w', /* FIXME */
optbl[pc->op].txt,
addr2txt(&pc->from1), addr2txt(&pc->from2));
}