Lines Matching +full:clang +full:- +full:msan +full:- +full:fuzz
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
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/
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.
105 We use the default ``-fsanitize=undefined`` option.
108 Pigweed does not currently support `MemorySanitizer`_ (msan). See
114 console`_, as ``pigweed-linux-san-*``.
116 Unlike clang-tidy, the clang sanitizers are runtime instrumentation: the
120 .. _AddressSanitizer: https://clang.llvm.org/docs/AddressSanitizer.html
121 .. _MemorySanitizer: https://clang.llvm.org/docs/MemorySanitizer.html
123 .. _ThreadSanitizer: https://clang.llvm.org/docs/ThreadSanitizer.html
124 .. _UndefinedBehaviorSanitizer: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
129 `Fuzz testing`_ detects errors in software by providing it with randomly
130 generated inputs. We use `OSS-fuzz`_ to continuously uncover potential
132 the :ref:`module-pw_fuzzer` module documentation for more details.
134 .. _Dashboard with Pigweed's latest results: https://oss-fuzz-build-logs.storage.googleapis.com/ind…
136 .. _OSS-fuzz: https://github.com/google/oss-fuzz
140 ----------------------------------
142 ----------------------------------
148 ---------------
158 clang-tidy
159 ----------
162 group performing static analysis. See :ref:`module-pw_toolchain` documentation
166 You can place a ``.clang-tidy`` file at the root of your repository to control
167 which checks are executed. See the `clang documentation`_ for a discussion of how
168 the tool chooses which ``.clang-tidy`` files to apply when run on a particular
172 .. _clang documentation: https://clang.llvm.org/extra/clang-tidy/
174 Clang sanitizers
175 ----------------
187 you can enable the clang sanitizers simply by setting the gn arg
198 .. code-block:: bash
200 gn gen out --args='pw_toolchain_SANITIZERS=["address"]'
201 ninja -C out host_clang_debug/obj/example/sample/bin/sample_binary
214 See the :ref:`module-pw_toolchain` module documentation for more
220 .. _docs-automated-analysis-clang-sanitizers:
222 Clang sanitizers
223 ----------------
227 .. code-block:: sh
229 bazel build --@pigweed//pw_toolchain/host_clang:asan //...
236 See the :ref:`module-pw_fuzzer` module documentation.