[PATCH] Default to -ansi and declare at top of block

From: sin <sin_AT_2f30.org>
Date: Wed, 15 Jul 2015 19:52:21 +0100

Without -ansi, the typeof() function was throwing errors.
---
 cc1/Makefile | 2 +-
 cc1/cpp.c    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cc1/Makefile b/cc1/Makefile
index c073ae6..ed8ac07 100644
--- a/cc1/Makefile
+++ b/cc1/Makefile
_AT_@ -1,4 +1,4 @@
-
+CFLAGS = -ansi
 OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \
 	code.o stmt.o cpp.o
 
diff --git a/cc1/cpp.c b/cc1/cpp.c
index cb2ce98..13ec31b 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
_AT_@ -218,7 +218,7 @@ int
 expand(Symbol *sym)
 {
 	unsigned len;
-	int r;
+	int r, n;
 	char *arglist[NR_MACROARG], arguments[INPUTSIZ], buffer[BUFSIZE];
 	char prevc, c, *bp, *lim, *arg, *s = sym->u.s;
 
_AT_@ -236,7 +236,7 @@ expand(Symbol *sym)
 	if ((r = parsepars(arguments, arglist, atoi(s))) < 1)
 		return r;
 
-	for (int n = 0; n < atoi(s); ++n)
+	for (n = 0; n < atoi(s); ++n)
 		fprintf(stderr, "PAR%d:%s\n", n, arglist[n]);
 
 	len = INPUTSIZ-1;
-- 
2.4.5
--f8l+LlZ8SWi5YGD2--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 15 2015 - 21:12:10 CEST