1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (rb_write_error2): get rid of warning on linux. fwrite

of glibc is tagged __attribute__ ((__warn_unused_result__))
  if _FORTIFY_SOURCE != 0.
* vm_dump.c (rb_vm_bugreport): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-11-27 12:06:10 +00:00
parent 9b58c2edf3
commit 8cee31214d
3 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,10 @@
Sun Nov 27 20:58:02 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* io.c (rb_write_error2): get rid of warning on linux. fwrite
of glibc is tagged __attribute__ ((__warn_unused_result__))
if _FORTIFY_SOURCE != 0.
* vm_dump.c (rb_vm_bugreport): ditto.
Sun Nov 27 19:09:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun Nov 27 19:09:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (stack_protector): disable on mingw. [Bug#5676] * configure.in (stack_protector): disable on mingw. [Bug#5676]

3
io.c
View file

@ -6596,7 +6596,8 @@ void
rb_write_error2(const char *mesg, long len) rb_write_error2(const char *mesg, long len)
{ {
if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) { if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
(void)fwrite(mesg, sizeof(char), len, stderr); int unused;
unused = fwrite(mesg, sizeof(char), len, stderr);
} }
else { else {
rb_io_write(rb_stderr, rb_str_new(mesg, len)); rb_io_write(rb_stderr, rb_str_new(mesg, len));

View file

@ -863,7 +863,8 @@ rb_vm_bugreport(void)
while (!feof(fp)) { while (!feof(fp)) {
char buff[0x100]; char buff[0x100];
size_t rn = fread(buff, 1, 0x100, fp); size_t rn = fread(buff, 1, 0x100, fp);
fwrite(buff, 1, rn, stderr); if (fwrite(buff, 1, rn, stderr) != rn)
break;
} }
fclose(fp); fclose(fp);