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

The interfacing from C to Ada section should talk about adainit and adafinal #906

Open
ButcherAdaCore opened this issue Jul 14, 2023 · 1 comment

Comments

@ButcherAdaCore
Copy link

Recently we've had the scenario of an AdaCore engineer (relatively new to Ada) trying to invoke an Ada library from a C main and the engineer couldn't figure out why there was uninitialised data. For anyone new to Ada the concept of elaboration and the runtime mechanics of how it actually works (the encapsulation of the calls makes it appear to just happen by magic!) can be non-intuitive. It feels to me like something that could also cause external engineers to trip up and therefore should be included in basic tutorials, or at least mentioned with a reference to the relevant section on an advanced course.

https://learn.adacore.com/courses/intro-to-ada/chapters/interfacing_with_c.html#calling-ada-subprograms-in-c

@burratoo
Copy link

At the very least the main.c example in Calling Ada subprograms in C should be calling adainit and adafinal. As it's currently written it's not correct code for use with our compilers.

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