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

LLD QOI: Warn if an export name matches a non-exported symbol #55

Open
davidchisnall opened this issue Dec 4, 2024 · 4 comments
Open
Assignees
Labels
good first issue Good for newcomers

Comments

@davidchisnall
Copy link

Export symbols are of the form _export{compartment name}_{mangled symbol name}. If we fail to resolve one of these, it would be nice to see if any of the input files has a private symbol that matches {mangled symbol name} and provide a diagnostic. This can happen if you have failed to mark a function with the __cher_compartment macro in the definition, but you did in a declaration that was visible to the caller.

@resistor resistor added the good first issue Good for newcomers label Dec 8, 2024
@resistor
Copy link
Collaborator

Staged here: resistor@7725db0

@resistor
Copy link
Collaborator

#78

@davidchisnall
Copy link
Author

@davidchisnall davidchisnall reopened this Jan 21, 2025
@resistor
Copy link
Collaborator

If you comment out this include: https://github.com/CHERIoT-Platform/book/blob/b2dad56c0246be29d268b0fea28b8e218d12a455/text/examples/compartment_annotation/compartment.cc#L4

I would expect the warning.

I think I see the issue now. The diagnostic will warn in the case where you have a correctly annotated implementation and an incorrectly annotated caller. You're looking for the inverse case, with an incorrectly annotated implementation and a correctly annotated caller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
2 participants