• Home
  • Raw
  • Download

Lines Matching +full:clang +full:- +full:tidy

1 .. _docs-automated-analysis:
11 -------
13 -------
18 * clang-tidy
22 * OSS-Fuzz
27 --------------
29 --------------
35 ------
45 your Pigweed-based project.
51 ----
59 a list of strings---since both are iterables this bug might otherwise be hard
67 .. _Mypy: http://mypy-lang.org/
69 clang-tidy subsection
70 ----------
71 `clang-tidy`_ is a C++ "linter" and static analysis tool. It identifies
72 bug-prone patterns (e.g., use after move), non-idiomatic usage (e.g., creating
76 While powerful, clang-tidy defines a very large number of checks, many of which
77 are special-purpose (e.g., only applicable to FPGA HLS code, or code using the
80 signal-to-noise ratios. The full list of Pigweed's checks is in `.clang-tidy`_.
82 We do not currently enable the `Clang Static Analyzers`_ because they suffer
83 from false positives, and their findings are time-consuming to manually verify.
85 clang-tidy can be run with ``ninja static_analysis`` or ``pw presubmit --step
86 static_analysis``. Note that as a static analysis tool, clang-tidy will not
89 .. _clang-tidy: https://clang.llvm.org/extra/clang-tidy/ target
91 .. _.clang-tidy: https://cs.pigweed.dev/pigweed/+/main:.clang-tidy
92 .. _Clang Static Analyzers: https://clang-analyzer.llvm.org/available_checks.html
95 Clang sanitizers
101 * asan: `AddressSanitizer`_ detects memory errors such as out-of-bounds access
102 and use-after-free.
106 We use the default ``-fsanitize=undefined`` option.
115 console`_, as ``pigweed-linux-san-*``.
117 Unlike clang-tidy, the clang sanitizers are runtime instrumentation: the
121 .. _AddressSanitizer: https://clang.llvm.org/docs/AddressSanitizer.html
122 .. _MemorySanitizer: https://clang.llvm.org/docs/MemorySanitizer.html
124 .. _ThreadSanitizer: https://clang.llvm.org/docs/ThreadSanitizer.html
125 .. _UndefinedBehaviorSanitizer: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
131 generated inputs. We use `OSS-fuzz`_ to continuously uncover potential
133 the :ref:`module-pw_fuzzer` module documentation for more details.
135 .. _Dashboard with Pigweed's latest results: https://oss-fuzz-build-logs.storage.googleapis.com/ind…
137 .. _OSS-fuzz: https://github.com/google/oss-fuzz
141 ----------------------------------
143 ----------------------------------
156 clang-tidy section in Enabling analysis for your project
160 group performing static analysis. See :ref:`module-pw_toolchain` documentation
164 You can place a ``.clang-tidy`` file at the root of your repository to control
165 which checks are executed. See the `clang documentation`_ for a discussion of how
166 the tool chooses which ``.clang-tidy`` files to apply when run on a particular
170 .. _clang documentation: https://clang.llvm.org/extra/clang-tidy/
172 Clang sanitizers
177 ---------------------------
185 you can enable the clang sanitizers simply by setting the gn arg
196 .. code-block:: bash
198 gn gen out --args='pw_toolchain_SANITIZERS=["address"]'
199 ninja -C out host_clang_debug/obj/example/sample/bin/sample_binary
203 --------------------
212 See the :ref:`module-pw_toolchain` module documentation for more
217 See the :ref:`module-pw_fuzzer` module documentation.