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

warnings when parsing projects with C #334

Open
briot opened this issue Sep 18, 2019 · 3 comments
Open

warnings when parsing projects with C #334

briot opened this issue Sep 18, 2019 · 3 comments
Labels

Comments

@briot
Copy link

briot commented Sep 18, 2019

I am not trying to parse C files :-)

But I have a few projects in the closure that include both C and Ada files, via the Languages attribute in the .gpr file. When I parse those projects via lal.UnitProvider.for_project, I get warnings on stdout (or stderr, not sure):

cjson.gpr:8:25: language unknown for "cJSON.c"

Obviously, libadalang cannot do anything with the C files, but it would be nice to just ignore them.
If I remember right, GNATCOLL.Projects supports this, but you need some initialization to register the language extensions. So maybe for_project needs a parameter like a dictionary mapping language names to extensions.

@raph-amiard
Copy link
Member

Thanks for the heads up. I think we just ignore the C files, but somehow GNATCOLL.Projects is still generating those warnings. We'll take a look into why it does that.

@briot
Copy link
Author

briot commented Sep 22, 2019 via email

@pjljvandelaar
Copy link

@briot The rejuvenation library offers some functions on top of libadalang that explicitly ignore non-Ada files:
See e.g. https://github.com/TNO/Rejuvenation-Ada/blob/fac22c0979872fb2a63ab2c12efd179912e6c3f5/src/rejuvenation-simple_factory.adb#L149

P.S. When you experiment on windows, be aware that using GNAT native 12.1.2 exposes a bug in libadalang's Create_Context function that is used within the functions I just referred you to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants