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

errno constants may exceed the range of representable integers of type int #409

Closed
glondu opened this issue Jun 22, 2016 · 1 comment · Fixed by #411
Closed

errno constants may exceed the range of representable integers of type int #409

glondu opened this issue Jun 22, 2016 · 1 comment · Fixed by #411

Comments

@glondu
Copy link
Contributor

glondu commented Jun 22, 2016

Hello,

Currently, ocaml-ctypes fails on hurd-i386 because ENOENT there is 1073741826 (0x40000002), which is greater than max_int (1073741823 aka 0x3fffffff). Actually, on Hurd, it seems that all errno constants are greater than 0x40000000.

@glondu
Copy link
Contributor Author

glondu commented Jun 24, 2016

There seems to be a fundamental problem in ocaml-ctypes: C's int are mapped to OCaml's int (as far as I understand). In Signed, Int.t should be abstract, like Long.t and LLong.t, and defined using pick and sizeof(int). I started to do this, but it requires many changes in the test-suite, which makes me think that change will break a lot of existing codebase. I'm tempted to try an alternative: leave Int.t concrete, and introduce a new abstract type for errno (that can of course be used elsewhere). Any opinions? Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant