shithub: scc

Download patch

ref: 0cd87289743d229d3407647ca918daa980fe8725
parent: 4faaf322b43040ad88b52e4917e753a64ea82b94
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue May 12 07:02:19 EDT 2015

Add comments

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -153,6 +153,7 @@
 	struct dcldata *bp;
 	Symbol *sym;
 
+	/* TODO: Change this code. The memset is a very bad idea */
 	memset(data, 0, sizeof(data));
 	data[NR_DECLARATORS].op = 255;
 	for (bp = declarator0(data, ns)-1; bp >= data; --bp) {
@@ -511,8 +512,9 @@
 		if (accept(';'))
 			return;
 		do {
-			setsafe(END_LDECL);
-			setjmp(recover);
+			/* FIX: we cannot put a setjmp here because
+			   base was already assigned, and we were having
+			   problems with EOF */
 			sym = declarator(base, ID_EXPECTED, NS_IDEN);
 			tp = sym->type;
 			sym->isstatic = 1;
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -39,6 +39,9 @@
 	FILE *fp;
 	unsigned short nline = 1;
 
+	/* TODO: Add a field in input to see easier which is the case
+	   where we are */
+
 	if (fname) {
 		if ((fp = fopen(fname, "r")) == NULL)
 			return 0;
@@ -543,6 +546,7 @@
 {
 	int c;
 
+	/* FIX: It will break all the error messages */
 repeat:
 	if (!fill())
 		return EOFTOK;
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -12,6 +12,7 @@
 static short localcnt;
 static short globalcnt;
 
+/* TODO: unify all the hashes in only one hash */
 static struct symtab {
 	Symbol *head;
 	Symbol *htab[NR_SYM_HASH];
--- a/cc1/types.c
+++ b/cc1/types.c
@@ -234,6 +234,7 @@
 	tbl = &typetab[t];
 	for (bp = *tbl; bp; bp = bp->next) {
 		if (eqtype(bp, &type)) {
+			/* FIXME: data can be a pointer to static data */
 			free(data);
 			return bp;
 		}