-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Summary
Some warnings were missing source locations (line/column), which made diagnostics less actionable and left recursion tests effectively unvalidated (no expectations found, skipping).
Problems
NeverInitializedlocal variable warnings sometimes had noline/column.- Recursion warnings (
recursive or mutually recursive,unconditional self recursion) had noline/columnin human output. - The test harness parity logic could miss recursion flags when diagnostics were preceded by
at line .... - Recursion test files had no expectations, so they were skipped.
Implemented Changes
- Added robust location recovery for uninitialized local variables in
src/analysis/UninitializedVarAnalysis.cpp. - Added recursion warning locations (function-level) in
src/StackUsageAnalyzer.cpp. - Updated human-vs-JSON parity parsing in
run_test.pyso recursion flags are detected even when location lines are present. - Added concrete expectations to recursion tests:
test/recursion/c/infinite-recursion.ctest/recursion/c/limited-recursion.ctest/recursion/cpp/infinite-recursion.cpptest/recursion/cpp/limited-recursion.cpp
- Added/updated expectation for uninitialized variable location:
test/uninitialized-variable/uninitialized-local-argument-never-used.c
Architecture Rationale
- Kept fixes local to diagnostics production rather than changing the global debug pipeline.
- Reused existing
aux.locationsas the single source of truth for function-level locations. - Used layered fallbacks for declaration recovery (debug metadata first, source-text fallback last) to improve robustness without broad side effects.
Result
- Human output now includes
at line X, column Yfor recursion warnings. - Recursion tests are no longer skipped and now assert expected diagnostics.
- Full test suite passes: 157/157.
Suggested Conventional Commits
fix(uninitialized): recover declaration line/column for never-initialized localsfeat(recursion): add source line and column to recursion diagnosticstest(recursion): add expectations for recursion diagnostics with locationsfix(test-runner): detect recursion flags in human output with location-prefixed diagnostics
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request