|
2 | 2 | # Use of this source code is governed by a BSD-style license that can be
|
3 | 3 | # found in the LICENSE file.
|
4 | 4 |
|
5 |
| -# The set of path prefixes that should be checked for unsafe pointer usage (see |
6 |
| -# -Wunsafe-buffer-usage in Clang). |
7 |
| -# |
8 |
| -# *** |
9 |
| -# Paths should be written as relative to the root of the source tree with |
10 |
| -# unix-style path separators. Directory prefixes should end with `/`, such |
11 |
| -# as `base/`. |
12 |
| -# *** |
13 |
| -# |
14 |
| -# Lines that begin with `-` name path prefixes that will *not* be checked for |
15 |
| -# unsafe-buffer-usage. They are known to do unsafe things and should be |
16 |
| -# changed to use constructs like base::span or containers like base::HeapArray |
17 |
| -# and std::vector instead. See https://crbug.com/40285824 |
18 |
| -# |
19 |
| -# Lines that begin with `+` name path prefixes that have no unsafe-buffer-usage |
20 |
| -# (or all such usage is annotated), and are protected against new unsafe pointer |
21 |
| -# behaviour by the compiler. |
22 |
| -# |
23 |
| -# By default, all files are checked for unsafe-buffer-usage unless they are |
24 |
| -# match a `-` path prefix line here. If a file matches both a `-` and `+` line, |
25 |
| -# the `+` line takes precedence and the file will be checked. |
26 |
| -# |
27 |
| -# To opt individual files out of checks, place `#pragma allow_unsafe_buffers` |
28 |
| -# anywhere in the (source or header) file, guarded by |
29 |
| -# `#ifdef UNSAFE_BUFFERS_BUILD`. These pragmas represent the technical debt and |
30 |
| -# security risk present in the file through unsafe pointer usage. |
31 |
| -# |
32 |
| -# *** |
33 |
| -# Recommended process for removing a `-dir/` line from this file: |
34 |
| -# |
35 |
| -# 1. Remove the `-dir/` line from this paths file. |
36 |
| -# a. Possibly add some subdirectories if needed to reduce scope, |
37 |
| -# like `-dir/sub_dir/`. |
38 |
| -# 2. Add `#pragma allow_unsafe_buffers` to every file in the directory that now |
39 |
| -# has a compilation error, with a TODO to the tracking bug for the |
40 |
| -# directory: |
41 |
| -# ``` |
42 |
| -# #ifdef UNSAFE_BUFFERS_BUILD |
43 |
| -# // TODO(crbug.com/ABC): Remove this and convert code to safer constructs. |
44 |
| -# #pragma allow_unsafe_buffers |
45 |
| -# #endif |
46 |
| -# ``` |
47 |
| -# 3. Work through the files in the directory, converting pointers to spans, or |
48 |
| -# to owning containers like HeapArray and vector. Remove the pragmas from |
49 |
| -# the files when there is no unsafe pointer usage left in each one. |
50 |
| -# |
51 | 5 | # See `docs/unsafe_buffers.md`.
|
52 | 6 |
|
53 | 7 | -base/allocator/
|
|
0 commit comments