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

Last line of #included file gets concatenated with next line #48

Open
pelrun opened this issue Oct 4, 2019 · 1 comment
Open

Last line of #included file gets concatenated with next line #48

pelrun opened this issue Oct 4, 2019 · 1 comment

Comments

@pelrun
Copy link

pelrun commented Oct 4, 2019

My codebase has multiple auto-generated headers that don't start or end with newlines. When they're included consecutively the first line of the second header ends up joined to the end of the last line of the first header. This resulted in something like the following:

#define MACRO (some + expression)#define SECONDMACRO

which of course cscout's parser choked on when MACRO was finally invoked in an expression.

CPP always keeps the lines separate in this case, and the project builds successfully.

@dspinellis
Copy link
Owner

I think this can be solved by having the built-in preprocessor add a newline token when a file's EOF is not preceded by a newline. Would you like to see if you can submit a corresponding pull request.

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