diff lwlink/link.c @ 264:346966cffeef

Clean up various warnings when building under -Wall Add some gimmicks to prevent fread() and fwrite() warnings about ignoring the return value. Yes, this is probably not a good thing to do, but doing something with a non-success return value is going to involve crashing out or something anyway. Also fix several warnings about variables used while possibly uninitialized. The code flow shows that this cannot be the case but initializing them to a plausible value at declaration time costs pretty much nothing and it makes gcc happy. Also caught a use of | instead of || which probably would have caused a certain check for duplicate declarations in __os9 sections to behave oddly.
author William Astle <lost@l-w.ca>
date Wed, 06 Feb 2013 21:43:10 -0700
parents 8dd8c3bdca7c
children fcd103148aa6
line wrap: on
line diff
--- a/lwlink/link.c	Tue Feb 05 22:39:34 2013 -0700
+++ b/lwlink/link.c	Wed Feb 06 21:43:10 2013 -0700
@@ -570,7 +570,7 @@
 	reloc_t *rl;
 	lw_expr_stack_t *te;
 	
-	int rval;
+//	int rval;
 
 	
 	if (fn -> forced == 0)
@@ -582,7 +582,7 @@
 		{
 			// do a "simplify" on the expression
 			te = lw_expr_stack_dup(rl -> expr);
-			rval = lw_expr_reval(te, resolve_sym, &(fn -> sections[sn]));
+			lw_expr_reval(te, resolve_sym, &(fn -> sections[sn]));
 			
 			// is it constant? error out if not
 			// incompletes will error out during resolve_references()
@@ -808,7 +808,7 @@
 	
 	if (st.attrseen > 1 || st.typeseen > 1 ||
 		st.langseen > 1 || st.revseen > 1 ||
-		st.nameseen > 1 | st.edseen > 1
+		st.nameseen > 1 || st.edseen > 1
 	)
 	{
 		fprintf(stderr, "Warning: multiple instances of __os9 found with duplicate settings of type, lang, attr, rev, edition, or module name.\n");