Fixup various warnings in Tint which were accidentally suppressed.
When enabling the SPIR-V reader or SPIR-V writer we were suppressing
-Wnewline-eof, -Wold-style-cast, -Wsign-conversion, and -Wweak-vtables
for the `libtint` cmake target and anything that depended on that
target. Because we'd build all readers/ writers by default this caused
us to never hit those warnings.
A recent change to the cmake build sets the Tint backend based on
the Dawn backend. So, there is a much higher chance of not building
the SPIR-V support if you're on a Mac or Windows machine.
This CL removes the suppression of the warnings, adds specific pragmas
into the SPIR-V reader code which imports the SPIRV-Tools headers
and fixes up the warnings which were then firing due to checking
for the new warnings.
Change-Id: I0d0be6aa3d0b692e939ce8ff924dfb82c82792fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94901
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc
index fd502d1..3e4352b 100644
--- a/src/tint/writer/hlsl/generator_impl.cc
+++ b/src/tint/writer/hlsl/generator_impl.cc
@@ -2107,7 +2107,7 @@
// Returns the argument with the given usage
auto arg = [&](Usage usage) {
int idx = signature.IndexOf(usage);
- return (idx >= 0) ? arguments[idx] : nullptr;
+ return (idx >= 0) ? arguments[static_cast<size_t>(idx)] : nullptr;
};
auto* texture = arg(Usage::kTexture);
@@ -3039,7 +3039,7 @@
// Emit the workgroup_size attribute.
auto wgsize = func_sem->WorkgroupSize();
out << "[numthreads(";
- for (int i = 0; i < 3; i++) {
+ for (size_t i = 0; i < 3; i++) {
if (i > 0) {
out << ", ";
}