Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler bug on dll call #2064

Closed
stugol opened this issue Jan 24, 2016 · 1 comment
Closed

Compiler bug on dll call #2064

stugol opened this issue Jan 24, 2016 · 1 comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler

Comments

@stugol
Copy link

stugol commented Jan 24, 2016

The code here throws a compiler bug.

@asterite asterite added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler labels Jan 25, 2016
@asterite
Copy link
Member

Good catch. I reduced it to this:

lib LibC
  fun foo(...)
end

LibC.foo(out x)

Basically, the use of out with variadic parameters. That shouldn't compile (because there's no way the compiler can figure out the type of x). As a workaround, you can use, in your case:

  def self.get_terminal_size
    screen_size = uninitialized Int32
    C.ioctl(0, tIOCGWINSZ, pointerof(screen_size))
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Projects
None yet
Development

No branches or pull requests

2 participants