summaryrefslogtreecommitdiffhomepage
path: root/.clangd
blob: d26fff363b50372eb1d900fcda92cd1874bff81f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# clangd settings for zash.  `make compdb` writes compile_commands.json; this
# file adds what that database cannot say.
CompileFlags:
  # The build uses these (see CSTD and CPPFLAGS in the Makefile), so the
  # editor sees the same language level and feature macros.
  Add: [-std=c23, -D_XOPEN_SOURCE=700, -Wall, -Wextra, -Wshadow,
        -Wstrict-prototypes, -Wmissing-prototypes, -Wconversion,
        -Wno-sign-conversion]
  # IBM Open XL and the z/OS-only file are not built on Linux.
  Remove: [-fzos-le-char-mode=*, -m64]
  CompilationDatabase: .

# src/sys_zos.c is never built on Linux, but it can still be checked: point
# clangd at a z/OS sysroot (/usr/include copied off a z/OS host) with the
# editor's own clangd config, e.g.
#   If: {PathMatch: .*/src/sys_zos\.c}
#   CompileFlags:
#     Add: [-m32, -D__LL, -D__builtin_zos_va_list=__builtin_va_list,
#           -D_ALL_SOURCE, -D_EXT, -D_OPEN_SYS_FILE_EXT=1,
#           -isystem, /path/to/sysroots/zos/usr/include]
# The path is per machine, so it does not belong in this file.


---
# Tests and benchmarks are shell scripts, not C.
If:
  PathMatch: (tests|bench)/.*
Diagnostics:
  Suppress: ['*']

---
Diagnostics:
  UnusedIncludes: Strict
  MissingIncludes: Strict
  ClangTidy:
    # Use .clang-tidy; do not duplicate its checks here.
    FastCheckFilter: Strict
    # Two checks .clang-tidy already switches off or allows.  clangd applies
    # its CheckOptions unevenly between clang-tidy versions, so name them
    # here too.  The tree writes `if (ptr)` and spells C11 keywords such as
    # _Static_assert, which are the implementation's namespace to define.
    Remove:
      - readability-implicit-bool-conversion
      - bugprone-reserved-identifier
Index:
  Background: Build
InlayHints:
  Enabled: false
Hover:
  ShowAKA: true
Completion:
  AllScopes: false
Style:
  FullyQualifiedNamespaces: []