cpp extension with clangdJune 10, 2019 at 3:51pm
I tried using clangd 8 along with cpp extension. it works fine. But, I created a C file (not C++ file) with void main() method, clangd complains that return type of main() function should be int and not void. I would like to be able to add & implement "void main()" method. How can i do it? How can i add options to clangd to suppress certain warnings?
June 11, 2019 at 7:18am
Also, this link describes installing clangd on ubuntu: https://github.com/theia-ide/theia/tree/master/packages/cpp. As theia docker image is based on node:10-alpine, it would be nice to get installation steps for node:10-alpine linux.
You can use a preference to pass some startup parameters to clangd, permitting the disabling of categories of warnings. For the example above, the following should work:
June 17, 2019 at 3:57pm
June 18, 2019 at 10:21am
July 25, 2019 at 6:41am
Here is the error that was logged:
root ERROR C/C++: clangd.exe: Unknown command line argument '-Wno-main-return-type'. Try: 'C:\Program Files\LLVM\bin\clangd.exe -help' clangd.exe: Did you mean '-completion-style'?
Confirmed - I get the same. I got fooled into thinking it worked because the diagnostics disappearing, but it did not work. As far as I can see, there is no way ATM to pass-on clang command-line arguments when starting clangd. Maybe asking the clangd community how to achieve this would be the way forward.
September 3, 2019 at 8:11am
I tried adding "-Wno-main-return-type" to compile_flags.txt file added to project root folder, it seems to work. Could you please confirm?
September 4, 2019 at 10:42am
September 5, 2019 at 3:22am
September 5, 2019 at 12:07pm
can you provide code for an example of such an include error? Looking quickly I did not see a way to disable these errors, so the way forward might rather be to configure the project so that clangd can find these includes.
September 13, 2019 at 4:01am
September 16, 2019 at 8:10am