Skip to content

Instantly share code, notes, and snippets.

@abiiranathan
Created August 13, 2024 12:38
Show Gist options
  • Save abiiranathan/28dd86f414a7418da530ad4c5b2dc03b to your computer and use it in GitHub Desktop.
Save abiiranathan/28dd86f414a7418da530ad4c5b2dc03b to your computer and use it in GitHub Desktop.
clangd configuration file for C/C++. Place it at /home/username/.clangd
InlayHints:
ParameterNames: No
DeducedTypes: No
Diagnostics:
UnusedIncludes: Strict
ClangTidy:
Add: [bugprone-*, cert-*, modernize-*, performance-*]
Remove: [bugprone-easily-swappable-parameters, modernize-use-trailing-return-type, cert-err33-c, cert-err34-c]
---
CompileFlags:
Add:
- '-Wall'
- '-Wextra'
- '-Werror'
Remove:
- '-W*' # Remove any existing warning flags
---
If:
PathMatch: '.*\.cpp'
CompileFlags:
Add:
- "-std=c++20"
- "-Wall"
- "-Werror"
- "-Wextra"
- "-ferror-limit=0"
Compiler: clang++
---
If:
PathMatch: '.*\.c'
CompileFlags:
Add:
- "-xc"
- "-Wall"
- "-Werror"
- "-Wextra"
- "-std=c2x"
- "-ferror-limit=0"
- "-fblocks"
Compiler: clang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment