# HG changeset patch # User William Astle # Date 1339279416 21600 # Node ID 52d9dd71f555cd90d46f38280eb87a1b164a2390 # Parent fa835b780ffb9dd8b26dcbee67137a5313b58f98 Make warning actually work. Make warnings actually work instead of being treated as errors. Also correct compiler warnings related to warning and error handling. diff -r fa835b780ffb -r 52d9dd71f555 lwasm/lwasm.c --- 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); diff -r fa835b780ffb -r 52d9dd71f555 lwasm/lwasm.h --- 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?