shithub: scc

Download patch

ref: 3bffda9fb4ff86d00ee0e4e488447480d869da87
parent: 0d3b55519d654762c70fad8b61dbaf52caf09601
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Jun 28 17:33:49 EDT 2020

cc1: Improve main loop

The for form was too obscure and a while loop makes
clearer the objective of the loop.

--- a/src/cmd/cc/cc1/main.c
+++ b/src/cmd/cc/cc1/main.c
@@ -98,8 +98,9 @@
 	if (onlycpp || onlyheader) {
 		outcpp();
 	} else {
-		for (next(); yytoken != EOFTOK; decl())
-			;
+		next();
+		while (yytoken != EOFTOK)
+			decl();
 	}
 
 	return failure;