This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] remote-mips.c: Fix ignored return value GCC warning
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 17 Jul 2011 21:23:55 +0200
- Subject: [obv] remote-mips.c: Fix ignored return value GCC warning
Hi,
with -O2 gcc-4.6.0-10.fc15.x86_64 complained:
remote-mips.c:3346:12: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2011-07/msg00154.html
--- src/gdb/ChangeLog 2011/07/15 20:54:30 1.13194
+++ src/gdb/ChangeLog 2011/07/17 19:22:31 1.13195
@@ -1,3 +1,7 @@
+2011-07-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * remote-mips.c (pmon_download): Fix ignored return value GCC warning.
+
2011-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup.
--- src/gdb/remote-mips.c 2011/03/29 15:49:51 1.121
+++ src/gdb/remote-mips.c 2011/07/17 19:22:32 1.122
@@ -3343,7 +3343,13 @@
pmon_download (char *buffer, int length)
{
if (tftp_in_use)
- fwrite (buffer, 1, length, tftp_file);
+ {
+ size_t written;
+
+ written = fwrite (buffer, 1, length, tftp_file);
+ if (written < length)
+ perror_with_name (tftp_localname);
+ }
else
serial_write (udp_in_use ? udp_desc : mips_desc, buffer, length);
}