-
Notifications
You must be signed in to change notification settings - Fork 5
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
ifndef vanishes from includes #49
Comments
This is because morty parses files individually, doing macro resolution of each, not taking into account the previously parsed files and the defines contained within. I attempted to make use of some of the parser's features to collect all the defines from the parsed files, but I haven't properly tested or investigated any further issues. You can give the following branch a shot if you like: https://github.com/pulp-platform/morty/tree/collect_defines |
Again, that was fast 😍 ! That should fix it, however it's difficult to estimate whether it would break backward compatibility. |
I will likely modify this feature to be enabled/disabled with a flag before merging to ensure compatibility isn't broken. |
Hi @micprog , |
Hi there!
When Morty pickles a header file such as
then it becomes
and this may cause tools to crash if the header is included multiple times.
I created an example here.
What workarounds would you suggest? Or is there anything that can be done in Morty to fix that problem?
I'm quite surprised to not have stumbled into this problem before so maybe I'm doing something wrong here.
Maybe doing such a typedef in a svh is also not legal, but can be found in the wild such as here.
Thanks!
Flavien
The text was updated successfully, but these errors were encountered: