[ruby-cvs:70402] shyouhei:r63312 (trunk): LIST_HEAD as a local variable is a C99ism.

shyouhei at ruby-lang.org shyouhei at ruby-lang.org
Tue May 1 13:41:11 JST 2018


shyouhei	2018-05-01 13:41:10 +0900 (Tue, 01 May 2018)

  New Revision: 63312

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63312

  Log:
    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.

  Modified files:
    trunk/io.c
    trunk/thread.c


More information about the ruby-cvs mailing list