aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-01 04:41:10 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-01 04:41:10 +0000
commita35d3e96f216e2442967535ce6d11b28144a8714 (patch)
tree831422bcb7974e41780745c3b2f9ab6ac5459c46 /io.c
parent0ea84edbb752467e53ba7e81871f4cc3bffff9d1 (diff)
downloadruby-a35d3e96f216e2442967535ce6d11b28144a8714.tar.gz
LIST_HEAD as a local variable is a C99ism.
Address of a variable whose storage duration is `auto` is _not_ a compile time constant, according to ISO 9899 section 6.4. LIST_HEAD takes such thing. You can't use it to declare local variables. Interestingly, address of a static variable _is_ a compile time constant. So a declaration like `static LIST_HEAD..` is completely legal even in C90. In C99 and newer, this is not a constraint violation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index c0457731d0..6a0d7114d2 100644
--- a/io.c
+++ b/io.c
@@ -4670,7 +4670,8 @@ io_close_fptr(VALUE io)
rb_io_t *fptr;
VALUE write_io;
rb_io_t *write_fptr;
- LIST_HEAD(busy);
+ struct list_head busy;
+ busy.n.next = busy.n.prev = &busy.n;
write_io = GetWriteIO(io);
if (io != write_io) {