* gas warning fix
@ 2005-02-21 11:56 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2005-02-21 11:56 UTC (permalink / raw)
To: binutils
c might be used uninitialized sez gcc-3.4
* input-file.c (input_file_open): Rearrange to avoid warning.
Index: gas/input-file.c
===================================================================
RCS file: /cvs/src/src/gas/input-file.c,v
retrieving revision 1.15
diff -u -p -r1.15 input-file.c
--- gas/input-file.c 19 Dec 2003 15:23:41 -0000 1.15
+++ gas/input-file.c 21 Feb 2005 02:59:55 -0000
@@ -146,21 +146,26 @@ input_file_open (char *filename, /* "" m
file_name = _("{standard input}");
}
- if (f_in)
- c = getc (f_in);
+ if (f_in == NULL)
+ {
+#ifdef BFD_ASSEMBLER
+ bfd_set_error (bfd_error_system_call);
+#endif
+ as_perror (_("Can't open %s for reading"), file_name);
+ return;
+ }
+
+ c = getc (f_in);
- if (f_in == NULL || ferror (f_in))
+ if (ferror (f_in))
{
#ifdef BFD_ASSEMBLER
bfd_set_error (bfd_error_system_call);
#endif
as_perror (_("Can't open %s for reading"), file_name);
- if (f_in)
- {
- fclose (f_in);
- f_in = NULL;
- }
+ fclose (f_in);
+ f_in = NULL;
return;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-02-21 3:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-21 11:56 gas warning fix Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).