diff lwasm/lwasm.c @ 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 348e2816ce32
children 5d969517db74
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);