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

fts example: foreign fails but stubgen suceeds on macos #587

Open
avsm opened this issue Dec 31, 2018 · 1 comment
Open

fts example: foreign fails but stubgen suceeds on macos #587

avsm opened this issue Dec 31, 2018 · 1 comment

Comments

@avsm
Copy link
Contributor

avsm commented Dec 31, 2018

(Just keeping track of this bug while working on #574)

On macos, the examples/fts/foreign version fails due to getting an invalid argument back for fts_info, but the stubgen one succeeds.

$ ./_build/fts.native  .
Fatal error: exception Invalid_argument("fts_info")

It seems to be a different number every time for fts_info_of_int, so needs more investigation.

avsm added a commit to rgrinberg/ocaml-ctypes that referenced this issue Dec 31, 2018
@yallop
Copy link
Owner

yallop commented Jan 12, 2019

This is quite likely due to different struct layouts for ftsent. For example, on Linux, fts_pathlen (which appears before fts_info) is an unsigned short, whereas on BSD it's a size_t. The stubgen test succeeds because it recovers the offsets from the C API rather than computing them from the OCaml code.

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

No branches or pull requests

2 participants