shithub: scc

Download patch

ref: 04a23f827762c3430fb2002d9eeca96bbad775ef
parent: cffac6768dcdad6bf8fadf8686b89c389a60dc22
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Jun 5 19:11:23 EDT 2012

Removed compiling warning

This commit removes some warning due to lost inclusions and incorrect
definition of user_opt, which was defined in a header included in different
places (so there were more of one definition of the same variable).

--- a/cc.h
+++ b/cc.h
@@ -5,12 +5,15 @@
 extern unsigned columnum;
 extern const char *filename;
 
-struct {
-	unsigned implicit_int : 1;
-	unsigned c99 : 1;
-	unsigned useless_typename : 1;
-} user_opt;
 
+struct user_opt {
+	unsigned char implicit_int;
+	unsigned char c99;
+	unsigned char useless_typename;
+};
+
+
+extern  struct user_opt user_opt;
 
 extern void warning(const char *fmt, ...);
 extern void error(const char *fmt, ...);
--- a/lex.c
+++ b/lex.c
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "cc.h"
 #include "symbol.h"
 #include "tokens.h"
 
--- a/main.c
+++ b/main.c
@@ -1,12 +1,13 @@
 
 #include <stddef.h>
 
+#include "cc.h"
 #include "tokens.h"
 #include "syntax.h"
 
 extern void open_file(const char *file);
 extern void init_lex();
-
+struct user_opt user_opt;
 
 
 
--- a/syntax.h
+++ b/syntax.h
@@ -6,4 +6,5 @@
 extern void compound(void);
 extern void expr(void);
 extern unsigned char decl(void);
+extern void type_name(void);
 #endif
--- a/types.c
+++ b/types.c
@@ -2,6 +2,7 @@
 #include <assert.h>
 #include <stdlib.h>
 
+#include "cc.h"
 #include "tokens.h"
 #include "types.h"