I'm not sure if this is actually allowed in C, or whether this is an extension compilers generally tend to implement, but there's other code in Ruby that declares variables at the top of non-function blocks so it's safe to do this.