shithub: scc

Download patch

ref: 928508eccd9699691f7ef41f508b669953e60b06
parent: 0ba1212867ef18e71a4f05ed19b6d0c89208e954
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Sep 25 14:35:52 EDT 2015

Add return type to function prototypes

--- a/cc1/code.c
+++ b/cc1/code.c
@@ -270,6 +270,8 @@
 		break;
 	case FTN:
 		emitletter(tp);
+		putchar('\t');
+		emitletter(tp->type);
 		n = tp->n.elem;
 		for (vp = tp->p.pars; n-- > 0; ++vp) {
 			putchar('\t');
--- a/cc1/tests/test001.c
+++ b/cc1/tests/test001.c
@@ -2,9 +2,9 @@
 name: TEST001
 description: Basic hello world test
 output:
-F3	P
+F3	I	P
 X4	F3	printf
-F5
+F5	I
 G6	F5	main
 {
 \
--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
@@ -3,7 +3,7 @@
 description: Test forward references before definition of types
 output:
 G4	P	x
-F7
+F7	I
 G8	F7	main
 {
 \
--- a/cc1/tests/test003.c
+++ b/cc1/tests/test003.c
@@ -2,7 +2,7 @@
 name: TEST003
 description: Select function to call inside ternary operator
 output:
-F1
+F1	I
 G2	F1	foo
 {
 \
--- a/cc1/tests/test004.c
+++ b/cc1/tests/test004.c
@@ -2,7 +2,7 @@
 name: TEST004
 description: Test integer operations
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test005.c
+++ b/cc1/tests/test005.c
@@ -2,7 +2,7 @@
 name: TEST005
 description: Test unary integer operations
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test006.c
+++ b/cc1/tests/test006.c
@@ -6,7 +6,7 @@
 test006.c:8: warning: conditional expression is constant
 test006.c:11: warning: conditional expression is constant
 G1	K	c
-F2
+F2	I
 G3	F2	main
 {
 \
--- a/cc1/tests/test007.c
+++ b/cc1/tests/test007.c
@@ -2,7 +2,7 @@
 name: TEST007
 description: basic while test
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test008.c
+++ b/cc1/tests/test008.c
@@ -2,7 +2,7 @@
 name: TEST008
 description: Basic do while loop
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test009.c
+++ b/cc1/tests/test009.c
@@ -2,7 +2,7 @@
 name: TEST009
 description: Basic test for loops
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test010.c
+++ b/cc1/tests/test010.c
@@ -5,7 +5,7 @@
 test010.c:9: warning: conditional expression is constant
 test010.c:11: warning: conditional expression is constant
 test010.c:31: warning: conditional expression is constant
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test011.c
+++ b/cc1/tests/test011.c
@@ -4,7 +4,7 @@
 output:
 test011.c:14: warning: 'foo' defined but not used
 test011.c:14: warning: 'start' defined but not used
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test012.c
+++ b/cc1/tests/test012.c
@@ -3,7 +3,7 @@
 description: Basic switch test
 output:
 test012.c:39: warning: 'foo' defined but not used
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test013.c
+++ b/cc1/tests/test013.c
@@ -16,7 +16,7 @@
 G9	O	i
 G10	I	j
 G11	N	k
-F12
+F12	I
 G13	F12	main
 {
 \
--- a/cc1/tests/test014.c
+++ b/cc1/tests/test014.c
@@ -14,7 +14,7 @@
 G1	I	a
 Y2	K	b
 X3	I	c
-F5
+F5	I
 G6	F5	func1
 {
 \
@@ -25,7 +25,7 @@
 T11	Z	a
 	r	#I0
 }
-F13	I
+F13	0	I
 G14	F13	func2
 {
 R12	I	par
--- a/cc1/tests/test015.c
+++ b/cc1/tests/test015.c
@@ -11,7 +11,7 @@
 S2	s
 M11	S5	s
 G12	S2	s2
-F13
+F13	I
 G14	F13	main
 {
 \
--- a/cc1/tests/test016.c
+++ b/cc1/tests/test016.c
@@ -4,7 +4,7 @@
 output:
 test016.c:43: error: redefinition of 'func2'
 G1	I	g
-F2
+F2	I
 G3	F2	func1
 {
 \
--- a/cc1/tests/test017.c
+++ b/cc1/tests/test017.c
@@ -2,7 +2,7 @@
 name: TEST017
 description: Basic test about pointers and structs
 output:
-F9
+F9	I
 G10	F9	main
 {
 \
--- a/cc1/tests/test018.c
+++ b/cc1/tests/test018.c
@@ -2,7 +2,7 @@
 name: TEST018
 description: Basic test for arrays
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test019.c
+++ b/cc1/tests/test019.c
@@ -5,7 +5,7 @@
 output:
 test019.c:13: warning: division by 0
 test019.c:14: warning: division by 0
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test020.c
+++ b/cc1/tests/test020.c
@@ -5,7 +5,7 @@
 output:
 test020.c:81: warning: division by 0
 test020.c:82: warning: division by 0
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test021.c
+++ b/cc1/tests/test021.c
@@ -4,7 +4,7 @@
 description: Basic test for char constants
 comments: This test is done for z80 implementation
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test022.c
+++ b/cc1/tests/test022.c
@@ -4,7 +4,7 @@
 description: Basic test for int constants
 comments: This test is done for z80 data types
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test023.c
+++ b/cc1/tests/test023.c
@@ -4,7 +4,7 @@
 description: Basic test for long constants
 comments: This test is done for z80 data types
 output:
-F1
+F1	I
 G2	F1	main
 {
 \
--- a/cc1/tests/test024.c
+++ b/cc1/tests/test024.c
@@ -4,7 +4,7 @@
 description: Basic test for long long constants
 comments: This test is done for z80 data types
 output:
-F1
+F1	I
 G2	F1	main
 {
 \