changeset 209:52d9dd71f555

Make warning actually work. Make warnings actually work instead of being treated as errors. Also correct compiler warnings related to warning and error handling.
author William Astle <lost@l-w.ca>
date Sat, 09 Jun 2012 16:03:36 -0600
parents fa835b780ffb
children 5d969517db74
files lwasm/lwasm.c lwasm/lwasm.h
diffstat 2 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/lwasm.c	Sat Jun 09 15:57:58 2012 -0600
+++ b/lwasm/lwasm.c	Sat Jun 09 16:03:36 2012 -0600
@@ -189,8 +189,7 @@
 	lwasm_error_t *e;
 	va_list args;
 	char errbuff[1024];
-	int r;
-	
+
 	if (!l)
 		return;
 
@@ -203,7 +202,7 @@
 	
 	as -> errorcount++;
 	
-	r = vsnprintf(errbuff, 1024, msg, args);
+	(void)vsnprintf(errbuff, 1024, msg, args);
 	e -> mess = lw_strdup(errbuff);
 	
 	va_end(args);
@@ -214,7 +213,6 @@
 	lwasm_error_t *e;
 	va_list args;
 	char errbuff[1024];
-	int r;
 	
 	if (!l)
 		return;
@@ -223,12 +221,12 @@
 	
 	e = lw_alloc(sizeof(lwasm_error_t));
 	
-	e -> next = l -> err;
-	l -> err = e;
+	e -> next = l -> warn;
+	l -> warn = e;
 	
-	as -> errorcount++;
+	as -> warningcount++;
 	
-	r = vsnprintf(errbuff, 1024, msg, args);
+	(void)vsnprintf(errbuff, 1024, msg, args);
 	e -> mess = lw_strdup(errbuff);
 	
 	va_end(args);
--- a/lwasm/lwasm.h	Sat Jun 09 15:57:58 2012 -0600
+++ b/lwasm/lwasm.h	Sat Jun 09 16:03:36 2012 -0600
@@ -260,6 +260,7 @@
 	int flags;							// assembly flags
 	int pragmas;						// pragmas currently in effect
 	int errorcount;						// number of errors encountered
+	int warningcount;					// number of warnings issued
 	int inmacro;						// are we in a macro?
 	int instruct;						// are w in a structure?
 	int skipcond;						// skipping a condition?