MaskRay / vscode-ccls

ccls plugin for Visual Studio Code
123 stars 37 forks source link

Avoid showing Error warning discoverd by ccls #69

Closed steinemann closed 5 years ago

steinemann commented 5 years ago

Hi,

I use ccls and the visual studio code plugin to work with a big codebase.

As we use a lot of macros in c++, it's common to write

MYMACRO(....);

Unfortunately the semicolon at the end of this usage produced an empty expression statement. ccls detects this and produces a lot of warning, that are shown like

"empty expression statement has no effect; remove unnecessary ';' to silence this warning ccls(4) [...]"

Is it possible to somehow avoid showing this specific message ?

Thanks

MaskRay commented 5 years ago

This is a clang specific diagnostic.

% g++ -fsyntax-only -Wextra-semi-stmt extra-semi-resulting-in-nullstmt.cpp                   
g++: error: unrecognized command line option ‘-Wextra-semi-stmt’; did you mean ‘-Wextra-semi’?

Add -Wno-extra-semi-stmt to your cxxflags and regenerate compile_commands.json.