-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Parse more C/C++ compiler options #2131
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be good. Add tests for all of these flags.
Well, adding these flags to c linter solves the header issue, but it also exposes another problem:
The |
Passing all flags found to c linter seems necessary, with the potential issue of 'unrecognized option'. |
ALE only pases the flags it passes because that's all that has been implemented so far. Once someone implements more support for parsing the right flags, then they will work. There will probably be some flags we shouldn't pass, like |
Can you explain why we shouldn't pass |
Yes. Say if a C or C++ complier passes an option like The problem is just trying to figure out which flags shouldn't be included, and how to exclude those flags. The way you implement that is by adding a large series of tests which capture all of the cases, such that there are no important cases which are not tested, and everything is covered. |
@w0rp I found a summary of update: forget to mention, I only tested for clang. |
Yeah, if it works, try it. All that matters is that relatively accurate output is produced, and we don't generate binary files or execute code. Being able to delete the messy code for parsing the flags would be nice bonus. |
@w0rp Passing all options to
So I passed all but |
There may be other conflicting options in |
Sure, go ahead and update the tests. |
Okay, I merged a PR for problems with minuses from another guy. Update the code and the tests here, so everything passes now. |
The tests failed, so have a look at those. |
I just merged a PR for caching, so you'll need to rebase your commits here. It looks like you used Fix the tests here. |
I'm preparing my final exams these days. I'll fix it later. |
Sure thing. Thank you for trying to make this better! |
ed54c52
to
3cc4324
Compare
@w0rp I've updated. |
Cheers! 🍻 |
According gcc manual, in addition to '-I/path/to/include', there are many other flags can be used to add header search directory. Qt with cmake use '-isystem' to include Qt headers, if not adding these flags to cflag_line, ale cannot find Qt headers. This PR adds these flags to cflag_line.