Skip to content

Commit 3dd73ff

Browse files
tsepezcopybara-github
authored andcommitted
Move some documentation into unsafe_buffers.md
Move some text from unsafe_buffers_paths.txt into the markdown file so that it may be more easily discovered. Hidden benefit of not reading and discarding so many comment lines in each compiler invocation. Re-arrange and re-write sections to make flow more natural. Change-Id: I077cf0d91cdd52a36cde9bb7c882ce3cf1fd6785 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6251406 Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Commit-Queue: Tom Sepez <[email protected]> Cr-Commit-Position: refs/heads/main@{#1418875} NOKEYCHECK=True GitOrigin-RevId: d647d84dc800a3cce6b8bbbc3ecfb4a22ceb0aa8
1 parent 6eb743c commit 3dd73ff

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

config/unsafe_buffers_paths.txt

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,6 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

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-
#
515
# See `docs/unsafe_buffers.md`.
526

537
-base/allocator/

0 commit comments

Comments
 (0)