Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C standard not recognized in CMake project, causing incorrect linting errors #16834

Closed
1 task done
Fostidich opened this issue Aug 25, 2024 · 2 comments
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

Comments

@Fostidich
Copy link

Check for existing issues

  • Completed

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.

set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED ON)

I generate the compile_commands.json file with cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ...
Inserting a raw string literal in the C code like R"(rawstringliteral)" will generate an errors such as clang: 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

image

If applicable, attach your Zed.log file to this issue.

No response

@Fostidich Fostidich added admin read bug [core label] labels Aug 25, 2024
@Moshyfawn Moshyfawn added c++ C++ programming language support language server failure Language server doesn't work as expected language server An umbrella label for all language servers and removed triage labels Aug 28, 2024
@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors and removed admin read labels Aug 30, 2024
Copy link

Hi there! 👋
We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days.
Thanks for your help!

@github-actions github-actions bot added the stale Label used by `stale` action label Mar 18, 2025
Copy link

This issue was closed due to inactivity. If you're still experiencing this problem, please open a new issue with a link to this issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants