Suppress unsafe-buffer-usage in ir fuzzing. The IR fuzzing code needed some more suppressions for the `unsafe-buffer-usage` warning. The `unsafe-buffer-usage-in-libc-call` has been suppressed in CMake for now. Change-Id: I2184b3c34870c77bb421a4fba50d732386d4e151 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/222814 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Auto-Submit: dan sinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt index 9b1465c..8692171 100644 --- a/src/tint/CMakeLists.txt +++ b/src/tint/CMakeLists.txt
@@ -119,6 +119,7 @@ -Wno-used-but-marked-unused -Weverything -Wunsafe-buffer-usage + -Wno-unsafe-buffer-usage-in-libc-call ) if(COMPILER_IS_GNU)
diff --git a/src/tint/cmd/fuzz/ir/as/main.cc b/src/tint/cmd/fuzz/ir/as/main.cc index 304ef79..a9b6f2b 100644 --- a/src/tint/cmd/fuzz/ir/as/main.cc +++ b/src/tint/cmd/fuzz/ir/as/main.cc
@@ -51,6 +51,8 @@ #include "src/tint/utils/protos/ir_fuzz/ir_fuzz.pb.h" TINT_END_DISABLE_PROTOBUF_WARNINGS(); +TINT_BEGIN_DISABLE_WARNING(UNSAFE_BUFFER_USAGE); + namespace { struct Options { @@ -339,3 +341,5 @@ return EXIT_SUCCESS; } + +TINT_END_DISABLE_WARNING(UNSAFE_BUFFER_USAGE);
diff --git a/src/tint/cmd/fuzz/ir/dis/main.cc b/src/tint/cmd/fuzz/ir/dis/main.cc index ae52724..9b2e5e5 100644 --- a/src/tint/cmd/fuzz/ir/dis/main.cc +++ b/src/tint/cmd/fuzz/ir/dis/main.cc
@@ -50,6 +50,8 @@ #include "src/tint/utils/protos/ir_fuzz/ir_fuzz.pb.h" TINT_END_DISABLE_PROTOBUF_WARNINGS(); +TINT_BEGIN_DISABLE_WARNING(UNSAFE_BUFFER_USAGE); + namespace { /// @param data spriv shader to be converted @@ -411,3 +413,5 @@ return EXIT_SUCCESS; } + +TINT_END_DISABLE_WARNING(UNSAFE_BUFFER_USAGE);
diff --git a/src/tint/utils/macros/compiler.h b/src/tint/utils/macros/compiler.h index 9fd940c..d40180c 100644 --- a/src/tint/utils/macros/compiler.h +++ b/src/tint/utils/macros/compiler.h
@@ -138,6 +138,7 @@ TINT_DISABLE_WARNING_SIGN_CONVERSION \ TINT_DISABLE_WARNING_UNDEFINED_REINTERPRET_CAST \ TINT_DISABLE_WARNING_UNUSED_PARAMETER \ + TINT_DISABLE_WARNING_UNSAFE_BUFFER_USAGE \ TINT_DISABLE_WARNING_WEAK_VTABLES \ TINT_DISABLE_WARNING_ZERO_AS_NULLPTR \ TINT_REQUIRE_SEMICOLON