commit 44f9e2933acbab1af87cd114eb43f5ead70409ff
Author:     [email protected] <[email protected]>
AuthorDate: Thu May 5 14:37:23 2016 +0100
Commit:     Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Thu May 5 16:33:28 2016 +0200

    fix TEST043
    
    this patch fixes TEST043 by moving printing of return types for
    functions to happen on declarations only.
    
    From 7948150ac8cfe75879f9b480e7d1a36bc8140571 Mon Sep 17 00:00:00 2001
    From: rain1 <[email protected]>
    Date: Thu, 5 May 2016 14:25:49 +0100
    Subject: [PATCH] print return type only when function is declared

diff --git a/cc1/code.c b/cc1/code.c
index e140d56..fd0fe91 100644
--- a/cc1/code.c
+++ b/cc1/code.c
@@ -228,11 +228,6 @@ emitsym(unsigned op, void *arg)
 static void
 emitletter(Type *tp)
 {
-       if (tp->op == FTN) {
-               emitletter(tp->type);
-               putchar('\t');
-       }
-
        putchar(tp->letter);
        switch (tp->op) {
        case ARY:
@@ -388,6 +383,10 @@ emitdcl(unsigned op, void *arg)
        emittype(sym->type);
        emitvar(sym);
        putchar('\t');
+       if (sym->type->op == FTN) {
+               emitletter(sym->type->type);
+               putchar('\t');
+       }
        emitletter(sym->type);
        printf("\t\"%s", (sym->name) ? sym->name : "");
        if (sym->flags & ISFIELD)

Reply via email to