Spacevim: Fix the C/C++ compiler invalid argument bug in SpaceVim

Created on 29 Jan 2017  路  6Comments  路  Source: SpaceVim/SpaceVim

Expected behavior, english is recommend

When editing C/C++ source files, SpaceVim could compile the tile right after you :w, and show the warnings and errors. But some source files were written according to C++11 standard, which requires to add --std=c++11 or --std=c++14 argument to the compile command.

Environment Information

  • OS: Ubuntu 16.10
  • vim version: 8.0
  • neovim version:

The reproduce ways from Vim starting (Required!)

include\

int main()
{
int* p = nullptr;
auto i = 10;
return 0;
}

You can type it SpaceVim and

:w

SpaceVim will report errors in line 4, indicating that 'nullptr' is unidentified. However when you use auto type which also be a c++11 variable type, the compiler will only show a warning that remind you it requires --std=c++11 arguments.

Output of the ":message" command, and ":echo SpaceVim#logger#viewLog()"

screenshot from 2017-01-30 00-26-45

screenshot from 2017-01-30 00-33-39

Most helpful comment

SpaceVim use neomake as the lint, if you just want to use clang maker,
you can set let g:neomake_cpp_enabled_makers=["clang"], for more info please keep watch on the deoplete-clang2's issuse link show above.

All 6 comments

Okay. I will read it . Thank you very much .

Ionizing Radiation

Is there any workarounds for this? Also, if possible, how do you make it use clang instead of GCC?

I will write a doc for this issue, and I think I can fix it, but maybe it is not the best solution.

SpaceVim use neomake as the lint, if you just want to use clang maker,
you can set let g:neomake_cpp_enabled_makers=["clang"], for more info please keep watch on the deoplete-clang2's issuse link show above.

This is still an issue out of the box, but this resolved it:

let g:neomake_cpp_enable_markers=['clang']
let g:neomake_cpp_clang_args = ["-std=c++14", "-Wextra", "-Wall", "-fsanitize=undefined","-g"]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

teemola picture teemola  路  5Comments

wsdjeg picture wsdjeg  路  3Comments

zeroasterisk picture zeroasterisk  路  5Comments

keai4le picture keai4le  路  4Comments

eperfect picture eperfect  路  4Comments