yasuyuky / autocomplete-clang

https://atom.io/packages/autocomplete-clang
MIT License
112 stars 35 forks source link

Using autocomplete-clang on Linux kernel code #95

Closed useche closed 5 years ago

useche commented 8 years ago

I'm trying to use autocomplete-clang with the linux kernel code. However, when running, I'm getting the following errors in the console:

clang: error: unknown argument: '-fno-delete-null-pointer-checks' clang: error: unknown argument: '-maccumulate-outgoing-args' clang: error: unknown argument: '-mfentry' clang: error: unknown argument: '-fconserve-stack' clang: error: unknown argument: '-fdebug-prefix-map=/usr/local/home/useche/a=.'

After this, there is no suggestion.

I'm using the compile_commands.json file.

copsey commented 8 years ago

All of these are command line options supported by GCC but not by Clang, which are used to compile the Linux kernel and have nothing to do with autocomplete-clang. Is there a .clang_complete file in the same directory as the source code that contains these flags?

useche commented 8 years ago

Nop. Only a compile_commands.json. Would it help if I remove this options from the compile_comands.json?

copsey commented 8 years ago

Yes, try this and hopefully it will work 😄. The commands in compile_commands.json are used by the Node.js package clang-flags, which in turn is used by autocomplete-clang. You might then have trouble trying to compile the code with GCC though.

EDIT: Actually, from what I can tell, compile_commands.json is specific to Clang and is not even used by GCC! So these options should not be in your compile_commands.json file.

useche commented 8 years ago

Removing the GCC flags made these errors go away, but I keep hitting other problems. I'm currently using YouCompleteMe (clang based) in vim with the same set of files and compile_commands.json file, and I don't hit so many errors. I wonder if there is something wrong in my atom configuration. I'll keep trying.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.