Skip to content

2026PKUCourseHW5: Initialize potentially uninitialized variables#7135

Open
GenZeal-Lin wants to merge 2 commits intodeepmodeling:developfrom
GenZeal-Lin:hw5-case9-init-var
Open

2026PKUCourseHW5: Initialize potentially uninitialized variables#7135
GenZeal-Lin wants to merge 2 commits intodeepmodeling:developfrom
GenZeal-Lin:hw5-case9-init-var

Conversation

@GenZeal-Lin
Copy link

Unit Tests and/or Case Tests for my changes

  • No new unit test was added.
  • The modified code was manually reviewed to ensure that the affected local variables are initialized before use.
  • This change is small and localized, and it is intended to avoid potential undefined behavior caused by uninitialized values.

What's changed?

  • Initialize local variables that may otherwise be used without guaranteed assignment on all control-flow paths.
  • Keep the change minimal by using explicit initialization at declaration.
  • Improve robustness and make the control flow safer and easier to reason about.

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