comparison lwlink/objdump.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 fc8386b13399
children
comparison
equal deleted inserted replaced
263:8dd8c3bdca7c 264:346966cffeef
152 { 152 {
153 unsigned char *fp; 153 unsigned char *fp;
154 long cc; 154 long cc;
155 int val; 155 int val;
156 int bss; 156 int bss;
157 int constant; 157 // int constant;
158 158
159 static char *opernames[] = { 159 static char *opernames[] = {
160 "?", 160 "?",
161 "PLUS", 161 "PLUS",
162 "MINUS", 162 "MINUS",
178 cc = 8; 178 cc = 8;
179 179
180 while (1) 180 while (1)
181 { 181 {
182 bss = 0; 182 bss = 0;
183 constant = 0; 183 // constant = 0;
184 184
185 // bail out if no more sections 185 // bail out if no more sections
186 if (!(CURBYTE())) 186 if (!(CURBYTE()))
187 break; 187 break;
188 188
199 printf(" FLAG: BSS\n"); 199 printf(" FLAG: BSS\n");
200 bss = 1; 200 bss = 1;
201 break; 201 break;
202 case 0x02: 202 case 0x02:
203 printf(" FLAG: CONSTANT\n"); 203 printf(" FLAG: CONSTANT\n");
204 constant = 1; 204 // constant = 1;
205 break; 205 break;
206 206
207 default: 207 default:
208 printf(" FLAG: %02X (unknown)\n", CURBYTE()); 208 printf(" FLAG: %02X (unknown)\n", CURBYTE());
209 break; 209 break;