I use the clangd LSP for my C development, and usually it works great.
I typically work with gcc, so I have the CLANGD_FLAGS environment variable set to --query-driver=C:/path/to/compilers/g*. This picks up on gcc/g++ well. I also use the compiledb Python module in order to generate compile_commands.json from my make rules. Typically this involves running py -m compiledb make all.
However, I’ve now started development on a C project using a different compiler (qcc) for work. This compiler is for the QNX operating system. Unfortunately, clangd hates this compiler and reports tons of errors (thinks NULL, EXIT_SUCCESS, etc, are undeclared identifiers despite being included).
I have tried setting my query driver to be the path to the qcc compiler. I’ve also generated the compile_commands.json file from the make <rule> output using compiledb. None of this has worked.
My project compiles just fine, and I still get some nice LSP features from clangd, but the errors everywhere are driving me insane. I would like to avoid using QNX’s IDE (it has less features than Neovim even with these LSP problems), and I can’t find anything online about using clangd with qcc except this GitHub issue, which is unsolved. I have also tried the suggested solution of a wrapper shell/bat script around qcc to have the output in gcc style to no avail.
Here’s what my main function looks like despite compiling just fine:
I know qcc is a much lesser used compiler, but I thought I’d give asking here a chance in case there are other QNX developers or people who have encountered similar issues with other compilers.
