shithub: scc

Download patch

ref: 06c8e5d1ac23831304404343c9f07110540ae354
parent: 139e71769f1473cf942b020d4eb60cf6221f6db9
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Mar 18 03:45:22 EDT 2014

Remove redundant test of int default declarations

This check is done in in specifier, and since it is not going to
be a common case, it is better remove the redundant code and have
only the specifier version.

--- a/decl.c
+++ b/decl.c
@@ -314,14 +314,9 @@
 	struct symbol *sym;
 
 	switch (yytoken) {
-	case IDEN:
-		warn(options.implicit,
-		     "type defaults to 'int' in declaration");
-		tp = inttype;
-		break;
 	case SCLASS:
 		error("storage class '%s' in struct/union field", yytext);
-	case TYPE: case TQUALIFIER:
+	case IDEN: case TYPE: case TQUALIFIER:
 		tp = specifier(NULL);
 		break;
 	case ';':
@@ -470,12 +465,7 @@
 	forbid_eof = 1;
 
 	switch (yytoken) {
-	case IDEN:
-		warn(options.implicit,
-		     "type defaults to 'int' in declaration");
-		tp = inttype;
-		break;
-	case TYPE: case SCLASS: case TQUALIFIER:
+	case IDEN: TYPE: case SCLASS: case TQUALIFIER:
 		tp = specifier(&sclass);
 		if (sclass == REGISTER || sclass == AUTO)
 			error("incorrect storage class for file-scope declaration");