OmniThreadLibrary icon indicating copy to clipboard operation
OmniThreadLibrary copied to clipboard

Prevent "Variable might not have been initialized" warning.

Open alan008 opened this issue 5 months ago • 3 comments

Prevent "Variable 'size' might not have been initialized" warning. Prevent "Variable 'when' might not have been initialized" warning.

When project is build with strict compiler rules (Variable might not have been initialized=Error) , it does not compile at all.

Summary by Bito

This PR fixes compilation issues by explicitly initializing previously uninitialized variables. It adds else blocks with Assert(False) statements in src/GpStuff.pas to ensure all code paths are covered. These changes properly handle 'when' and 'size' variables under strict compiler rules, with minor formatting improvements.

alan008 avatar Sep 05 '25 19:09 alan008

Code Review Agent Run #f8f433

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 2d15895..2d15895
    • src/GpStuff.pas
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

bito-code-review[bot] avatar Sep 05 '25 19:09 bito-code-review[bot]

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - Fix Uninitialized Variables

GpStuff.pas - Added else blocks with Assert(False) to ensure 'when' and 'size' are always initialized, preventing uninitialized variable warnings during strict compilations.

bito-code-review[bot] avatar Sep 05 '25 19:09 bito-code-review[bot]

The problem with this is that these kinds of warnings have changed so much over the years.

Very difficult or time consuming to make all IDE versions happy.

-tee-

TommiPrami avatar Sep 06 '25 12:09 TommiPrami