linter-gcc
linter-gcc copied to clipboard
compile_commands.json ignored because cmake and linter-gcc use different path separator
Checklist
- [x] Check that you have the GNU C Compiler installed by typing
gcc --version
into a terminal. - [x] If you don't have the
linter
package installed, either update to the latest version oflinter-gcc
or install linter directly withapm install linter
. - [x] Ensure that you are using a valid grammar - either C/C++/C++14
- [x] Ensure that you have read all the relevant information in the wiki, particularly the Common Issues page.
Issue (including debugging messages):
The value of "file" in compile_commands.json generated by CMake on Windows uses slash, while gcc-linter uses backslash to identify the source file. So during debugging I found that in the file utility.js, at line 149, the if condition became false. So the arguments specified in compile_commands.json will be ignored compeletly
This problem can be fixed temporarily by modify the content of compile_command.json manually. But it will be tedious if there are more files.
I hope gcc-linter could supply a toggle to allow users on windows to choose the path separator.
Well, I found some package that can help me change the slashes in compile_commands.json. But I still hope linter could fix it.