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

Eval buffer in REPL does not emit main(), fails to compile #713

Closed
adityaathalye opened this issue Apr 17, 2020 · 3 comments · Fixed by #716
Closed

Eval buffer in REPL does not emit main(), fails to compile #713

adityaathalye opened this issue Apr 17, 2020 · 3 comments · Fixed by #716

Comments

@adityaathalye
Copy link

adityaathalye commented Apr 17, 2020

This issue is seen as of SHA 8440398

With reference to examples/arrays.carp

Eval buffer in REPL (bound to C-c C-l in emacs) fails to generate main() in examples/out/main.c causing the clang compile step to fail.

  • This is independently reproducible and has been confirmed by @hellerve
  • I can call (ex1) and (ex2) from the REPL and they work
  • However, calling (main) from the REPL fails and the inferior carp process exits
  • The examples/out/main.c file shows ex1() and ex2() generated along with the structs and includes, but does not have main()

I can further confirm that:

  • carp -x examples/arrays.carp works and produces the expected output.
  • Build-and-run (bound to C-c C-c in emacs) works and produces the expected output, in the inferior Carp process.
  • The fat binary generated by build-and-run at example/out/Untitled also successfully runs standalone and produces the expected output.
@hellerve
Copy link
Member

Thanks for looking into this!

I just want to add that I can confirm this in any Carp REPL, not just in emacs. Calling (main) will result in emitted C code that is missing its main function, weirdly.

@adityaathalye
Copy link
Author

I don't know why the issue got closed. I must have fat-fingered something.

@adityaathalye
Copy link
Author

I just tried this out... looking good. Thanks!

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.

2 participants