This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[OB] Fix build error in ui-file.c
- From: Hui Zhu <teawater at gmail dot com>
- To: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Sat, 14 May 2011 11:40:52 +0800
- Subject: [OB] Fix build error in ui-file.c
Get error with trunk:
gcc -g -O2 -I. -I../../src/gdb -I../../src/gdb/common
-I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\""
-DHAVE_CONFIG_H -I../../src/gdb/../include/opcode
-I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd
-I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber
-I../../src/gdb/../libdecnumber -I../../src/gdb/gnulib -Ignulib
-DMI_OUT=1 -DTUI=1 -DGDBTK -I/usr/include/python2.6
-I/usr/include/python2.6 -Wall -Wdeclaration-after-statement
-Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused
-Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
-Werror -c -o ui-file.o -MT ui-file.o -MMD -MP -MF .deps/ui-file.Tpo
../../src/gdb/ui-file.c
cc1: warnings being treated as errors
../../src/gdb/ui-file.c: In function ‘stdio_file_write_async_safe’:
../../src/gdb/ui-file.c:583: error: ignoring return value of ‘write’,
declared with attribute warn_unused_result
Fix it like others in this file.
2011-05-14 Hui Zhu <teawater@gmail.com>
* ui-file.c (stdio_file_write_async_safe): Add empty check for build.
===================================================================
RCS file: /cvs/src/src/gdb/ui-file.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- src/gdb/ui-file.c 2011/05/13 17:28:20 1.27
+++ src/gdb/ui-file.c 2011/05/14 03:37:18 1.28
@@ -580,7 +580,8 @@
return;
}
- write (stdio->fd, buf, length_buf);
+ if (write (stdio->fd, buf, length_buf))
+ ;
}
static void