Advertisement
QinghaoHu

My clangd setup

May 9th, 2024 (edited)
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. CompileFlags: # Tweak the parse settings
  2. Add: [-xc++, -Wall, -std=c++17] # treat all files as C++, enable more warnings
  3. Remove: -W* # strip all other warning-related flags
  4. Compiler: clang++ # Change argv[0] of compile flags to `clang++`
  5. Diagnostics:
  6. UnusedIncludes: None
  7.  
  8. Bashrc setup:
  9. comp() {
  10. filename="${1%.cpp}" # 获取输入文件名,去掉扩展名
  11. clang++ -O2 -Wall -Wfatal-error "$1" -o "$filename" # 编译并输出为输入文件名 + .out
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement