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

Support for include_next #7

Open
ochafik opened this issue Nov 5, 2013 · 2 comments
Open

Support for include_next #7

ochafik opened this issue Nov 5, 2013 · 2 comments

Comments

@ochafik
Copy link

ochafik commented Nov 5, 2013

Although jcpp parses #include_next, it doesn't seem to skip the current file's directory.

See http://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

Here's a fix from JNAerator's fork:

ochafik@823a020

@shevek
Copy link
Owner

shevek commented Dec 28, 2013

That's because I lashed this all up in the mid '90s and didn't read the documentation! I did pretty well, considering! :-)

@shevek
Copy link
Owner

shevek commented Dec 28, 2013

I've written enough virtual filesystem handling code in my life to be cautious and nervous about implementing this properly. As I see it, the linked patch prevents reincluding a file which was relative to the parent, but does not correctly implement include_next if both the first and the next header are in the system include directories, nor can it handle a chain of more than one 'next' inclusion.

I'll have to think about this somewhat more, but I'm reluctant to take the patch into trunk with those weaknesses. Fundamentally, the weakness is in the vfs code, because it doesn't really allow one to identify a file; following which one would have to walk the Source stack and ensure that the proposed source (VirtualFile) was not on the stack already, which would require a change to Source ("Are you this VF?") as well.

I'll let that settle into our brains for a bit before I come back to it.

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