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

Add header file for compcert compatibility #604

Merged
merged 1 commit into from Jan 16, 2019
Merged

Conversation

gjurgensen
Copy link
Contributor

Currently, compiling basis_ffi.c with compcert (the newest release, version 3.4) results in the following error "use of undeclared identifier 'S_IRUSR'". This macro, along with the other mode arguments for open(), are defined in sys/stat.h. Including this header resolves the issue.

I'm not sure why this isn't a problem when compiling under gcc. I assume one of the other header files includes sys/stat.h, but I was also under the assumption that both compcert and gcc would use the same system-provided header files. Regardless, the linux man page for open() seems to suggest including sys/stat.h (as well as sys/types.h, although this was not necessary on my machine), so including these may be wise for portability reasons.

@xrchz
Copy link
Member

xrchz commented Jan 15, 2019

Happy to merge this upon confirmation (from anyone) that the new file also works with gcc and/or clang on GNU/Linux and macOS

@gjurgensen
Copy link
Contributor Author

I can confirm it works on GNU/Linux (specifically Ubuntu 18.04.1). Using gcc and then clang, I generated assembly for the original basis_ffi.c, and my modified version. I compared them with diff, and the only difference was the name of the file.

Unfortunately, I don't have the means to test on macOS.

@xrchz xrchz merged commit 4c7bf47 into CakeML:master Jan 16, 2019
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 this pull request may close these issues.

None yet

2 participants