[hackers] [scc] fix TEST043 || rain1_AT_openmailbox.org
commit 44f9e2933acbab1af87cd114eb43f5ead70409ff
Author: rain1_AT_openmailbox.org <rain1_AT_openmailbox.org>
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 <rain1_AT_openmailbox.org>
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
_AT_@ -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:
_AT_@ -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)
Received on Fri May 06 2016 - 18:25:54 CEST
This archive was generated by hypermail 2.3.0
: Fri May 06 2016 - 18:36:24 CEST