Skip to content

Fix signed/unsigned mismatch in LinAlgTests.cpp#8336

Merged
damyanp merged 2 commits intomicrosoft:mainfrom
damyanp:user/damyanp/fix-linalg-signed-unsigned-mismatch
Apr 3, 2026
Merged

Fix signed/unsigned mismatch in LinAlgTests.cpp#8336
damyanp merged 2 commits intomicrosoft:mainfrom
damyanp:user/damyanp/fix-linalg-signed-unsigned-mismatch

Conversation

@damyanp
Copy link
Copy Markdown
Member

@damyanp damyanp commented Apr 3, 2026

Change loop variables from int32_t to size_t to match the NumElements parameter type (size_t), fixing C4018 warnings treated as errors in x86 builds.

Assisted-By: Copilot

Change loop variables from int32_t to size_t to match the NumElements
parameter type (size_t), fixing C4018 warnings treated as errors in
x86 builds.

Co-authored-by: Copilot <[email protected]>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 475e3ccc4bf1d749e88bcc4b6cecba8bd93a81ed e9b6aa2b62432058f4549e817ea07b6caec87562 -- tools/clang/unittests/HLSLExec/LinAlgTests.cpp
View the diff from clang-format here.
diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp
index 96f4aa88..3ab1ac1d 100644
--- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp
+++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp
@@ -235,7 +235,8 @@ static VariantCompType makeExpected(ComponentType CompType, size_t NumElements,
              "Value too large to cast to int32_t");
     std::vector<int32_t> Ints(NumElements);
     for (size_t I = 0; I < NumElements; I++)
-      Ints[I] = static_cast<int32_t>(StartingVal) + static_cast<int32_t>(Increment ? I : 0);
+      Ints[I] = static_cast<int32_t>(StartingVal) +
+                static_cast<int32_t>(Increment ? I : 0);
     return Ints;
   }
   case ComponentType::F16: {
  • Check this box to apply formatting changes to this branch.

@damyanp damyanp enabled auto-merge (squash) April 3, 2026 19:29
@damyanp damyanp merged commit e12898c into microsoft:main Apr 3, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Apr 3, 2026
V-FEXrt added a commit that referenced this pull request Apr 10, 2026
Comparing `int32_t` for M/N to `size_t` caused failures on internal
pipelines ala
#8336

Since M/N don't make sense as negative values remove the entire class of
errors by changing them to unsigned types.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tex Riddell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants