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

Unable to parse some import values #1738

Closed
rgrinberg opened this issue Jan 4, 2019 · 4 comments
Closed

Unable to parse some import values #1738

rgrinberg opened this issue Jan 4, 2019 · 4 comments
Assignees

Comments

@rgrinberg
Copy link
Member

See, the following error message produced on 4.02.3/OSX:

compiling c program:
 | #include <stdio.h>
 | #include <ffi.h>
 |
 |
 | #define DUNE_ABS(x) ((x >= 0)? x: -(x))
 | #define DUNE_D0(x) ('0'+(DUNE_ABS(x)/1         )%10)
 | #define DUNE_D1(x) ('0'+(DUNE_ABS(x)/10        )%10), DUNE_D0(x)
 | #define DUNE_D2(x) ('0'+(DUNE_ABS(x)/100       )%10), DUNE_D1(x)
 | #define DUNE_D3(x) ('0'+(DUNE_ABS(x)/1000      )%10), DUNE_D2(x)
 | #define DUNE_D4(x) ('0'+(DUNE_ABS(x)/10000     )%10), DUNE_D3(x)
 | #define DUNE_D5(x) ('0'+(DUNE_ABS(x)/100000    )%10), DUNE_D4(x)
 | #define DUNE_D6(x) ('0'+(DUNE_ABS(x)/1000000   )%10), DUNE_D5(x)
 | #define DUNE_D7(x) ('0'+(DUNE_ABS(x)/10000000  )%10), DUNE_D6(x)
 | #define DUNE_D8(x) ('0'+(DUNE_ABS(x)/100000000 )%10), DUNE_D7(x)
 | #define DUNE_D9(x) ('0'+(DUNE_ABS(x)/1000000000)%10), DUNE_D8(x)
 | #define DUNE_SIGN(x) ((x >= 0)? '+': '-')
 |
 |
 | const char s0[] = {
 |   'B', 'E', 'G', 'I', 'N', '-', '0', '-',
 |   DUNE_SIGN((FFI_FASTCALL)),
 |   DUNE_D9((FFI_FASTCALL)),
 |   '-', 'E', 'N', 'D'
 | };
 |
run: cc -O  -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O  '-I/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1/include' '-I' '/Users/rgrinberg/.opam/4.02.3/lib/ocaml' '-o' '/var/folders/tz/tvzjldvx3s34fnw1qs9lk1240000gn/T/ocaml-configuratordbaa52/c-test-55/test.o' '-c' '/var/folders/tz/tvzjldvx3s34fnw1qs9lk1240000gn/T/ocaml-configuratordbaa52/c-test-55/test.c'
-> process exited with code 0
-> stdout:
-> stderr:
Error: Unable to read variable "FFI_FASTCALL" of type int. Invalid value "+0000000004" in /var/folders/tz/tvzjldvx3s34fnw1qs9lk1240000gn/T/ocaml-configuratordbaa52/c-test-55/test.o found

@Chris00 can you take over this?

@Chris00
Copy link
Member

Chris00 commented Jan 4, 2019 via email

@rgrinberg
Copy link
Member Author

Because we only run the tests on the latest version.

@Chris00
Copy link
Member

Chris00 commented Jan 4, 2019 via email

@rgrinberg
Copy link
Member Author

Yeah, that certainly be preferable. I think some of our expect tests aren't entirely portable across different versions of the compiler. So it's not so easy to solve, but we should certainly address this.

Chris00 added a commit to rgrinberg/jbuilder that referenced this issue Jan 4, 2019
The function int_of_string in OCaml 4.02 does not support a leading '+'.

Fixes ocaml#1738

Signed-off-by: Christophe Troestler <[email protected]>
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