Skip to content

Fix C4018 signed/unsigned comparison warnings - #714

Merged
ASDAlexander77 merged 1 commit into
mainfrom
fix-c4018-signed-unsigned
Oct 28, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
fix-c4018-signed-unsigned

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Fixes the MSVC C4018: signed/unsigned mismatch warnings in MLIRTypeScript:

  • MLIRGenImpl.h: the interface-thunk argument loop now uses an unsigned counter, matching getNumInputs()
  • MLIRGenVariables.cpp: the past-the-end check casts the binding index to unsigned before comparing it with ConstArrayType::getSize()
  • MLIRGenGenerics.cpp: inferTypeFuncType now uses a size_t counter
  • DiagnosticHelper.cpp: printDiagnostics keeps a signed counter and casts size() instead. Its inner loop counts back to 0 with >= 0, so an unsigned counter would wrap around.

Release build has no warnings; ctest -C Release: 100% passed (6082).

🤖 Generated with Claude Code

Give the loop counters and the bounds check the type of the size they
compare against. printDiagnostics keeps a signed counter because its
inner loop walks back to index 0 with `>= 0`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 3d81e19 into main Oct 28, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the fix-c4018-signed-unsigned branch October 28, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant