Skip to content

Commit

Permalink
build: enable -Wunsafe-buffer-usage warnings (#44056)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckerr authored Oct 29, 2024
1 parent de04fc3 commit fb959f8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build/args/all.gn
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ enterprise_cloud_content_analysis = false
# TODO: remove dependency on legacy ipc
# https://issues.chromium.org/issues/40943039
content_enable_legacy_ipc = true

# Electron has its own unsafe-buffers enforcement directories.
clang_unsafe_buffers_paths = "//electron/electron_unsafe_buffers_paths.txt"
34 changes: 34 additions & 0 deletions electron_unsafe_buffers_paths.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2024 The Electron Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# The set of path prefixes that should be checked for unsafe buffer usage (see
# -Wunsafe-buffer-usage in Clang).
#
# ***
# Paths should be written as relative to the root of the source tree with
# unix-style path separators. Directory prefixes should end with `/`, such
# as `base/`.
# ***
#
# Files in this set are known to not use pointer arithmetic/subscripting, and
# make use of constructs like base::span or containers like std::vector instead.
#
# See `docs/unsafe_buffers.md`.

# These directories are excluded because they come from outside Electron and
# we don't have control over their contents.
-base/
-chrome/
-components/
-device/
-extensions/
-google_apis/
-net/
-services/
-skia/
-third_party/
-tools/
-ui/
-url/
-v8/

0 comments on commit fb959f8

Please sign in to comment.