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

Fix flycheck clang args loading #2635

Closed
wants to merge 1 commit into from
Closed

Fix flycheck clang args loading #2635

wants to merge 1 commit into from

Conversation

zhengyangfeng00
Copy link

Trying to resolve #1258

@StreakyCobra
Copy link
Contributor

FTR this PR has been tried by 2 persons on #1258 and reported it to be successfully solving it.

@zhengyangfeng00 Can you rebase it on develop to have a chance of being merged.

@pszynk
Copy link

pszynk commented Nov 12, 2015

this solved the problem with loading .clang_complete file.

When merging note that function add-to-hooks was renamed to spacemacs/add-to-hooks

Also i think that the regexp for replacing relative path with absolute ones is not exactly right, two points.

  1. .clang_complete file is said to contain one clang flag per line, maybe one option per line would be more precise. That means that -isystem <some dir> should probably be one line in the file, but the regexp assumes it's split in two lines. Maybe it's minor thing, but it can be misleading. As a reference here's doc for a vim plugin that uses .clang_complete file link.

  2. this is actually an error. Replacing paths doesn't take into account that the line can look like this:

-I../<some_file>

it takes the first . , applies function expand-file-name with path/to/.clang_complete and replaces first . with the result. Only we are left with the second . and in the end it looks like this:

-I</absolute/path/to/.clang_complete>./<some_file> (note left .)

I'd be happy to propose better solution, but I'm still a bit green in elisp.

@TheBB
Copy link
Collaborator

TheBB commented Nov 15, 2015

Hi guys.

Was about to merge this but the repository has been deleted. Therefore I've opened #3819 with essentially the same changes. I hope that is okay with you @zhengyangfeng00 (you will get credit in the changelog). Since I don't use clang that much I would appreciate some code review over there. In particular your comments @pszynk... I'm not sure how they would apply, exactly.

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

Successfully merging this pull request may close these issues.

4 participants