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

Cannot parse 'inline' from OCaml headers #47

Open
edwintorok opened this issue May 31, 2021 · 0 comments
Open

Cannot parse 'inline' from OCaml headers #47

edwintorok opened this issue May 31, 2021 · 0 comments

Comments

@edwintorok
Copy link

Using calipso/FrontC 4.0.0 on Fedora34:

cat >x.c <<EOF
#include "caml/mlvalues.h"
#include "caml/memory.h"
#include "caml/alloc.h"

value dummy(value x) {
  CAMLparam1(x);
  CAMLreturn(x);
}
EOF
calipso_stat -p 'gcc -std=c99 -E -I /home/edwin/.opam/4.11.0/lib/ocaml/ %i -o %o' y.c
/home/edwin/.opam/4.11.0/lib/ocaml/caml/misc.h[214] Syntax error: static inline int caml_uadd_overflow(uintnat a, uintnat b, uintnat * res)
goto total = 0
goto average = -
goto maximum = 0
goto functions = 0
label total = 0
label average = -
label maximum = 0
label functions = 0

Note: std=c99 is needed otherwise it fails at a different place:
/usr/lib/gcc/x86_64-redhat-linux/11/include/stddef.h[416] Syntax error: long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));

(If I save the preprocessed file and delete the inline the next failure will be:
/usr/include/stdio.h[415] Syntax error: extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__)))

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

1 participant