C standard not recognized in CMake project, causing incorrect linting errors #16834
Closed
1 task done
Labels
bug
[core label]
c++
C++ programming language support
language server failure
Language server doesn't work as expected
language server
An umbrella label for all language servers
language
An umbrella label for all programming languages syntax behaviors
stale
Label used by `stale` action
Check for existing issues
Describe the bug / provide steps to reproduce it
I've encountered an issue when using the C23 standard in my CMake project.
Specifically, the editor doesn't seem to recognize C23 features, which leads to incorrectly lint errors.
In my case, the editor flags the use of raw string literals (i.e., R"()") as an error, even though they are valid in C23.
CMakeLists.txt contains the following lines.
I generate the
compile_commands.json
file withcmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
.Inserting a raw string literal in the C code like
R"(rawstringliteral)"
will generate an errors such asclang: Use of undeclared identifier 'R'
.Environment
Zed: v0.149.5 (Zed)
OS: Linux Wayland ubuntu 24.04
Memory: 6.7 GiB
Architecture: x86_64
GPU: AMD Radeon Vega 8 Graphics (RADV RAVEN) || radv || Mesa 24.0.9-0ubuntu0.1
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your Zed.log file to this issue.
No response
The text was updated successfully, but these errors were encountered: