Skip to content

Detect partial reductions in expected compiler warnings #159340

Closed as not planned
Closed as not planned

Description

@esadomer

get_unexpected_improvements() ignores a file while it still has warnings, even when the count is below its finite ignore rule. It also reports an improvement for a zero-count rule with no warnings.

Reproducer, run with the interpreter built from the CPython checkout:

import sys
sys.path.insert(0, 'Tools/build')
import check_warnings

rules = {check_warnings.IgnoreRule('source.c', 2)}
print(check_warnings.get_unexpected_improvements(
    rules, {'source.c': [{}]}))

rules = {check_warnings.IgnoreRule('source.c', 0)}
print(check_warnings.get_unexpected_improvements(rules, {}))

Expected: The first call reports the reduction and returns 1; the second returns 0.

Observed: The first call returns 0. The second reports an improvement and returns 1.

Environment: CPython main, Windows debug build.

Linked PRs

Activity

  1. added a commit that references this issue on Oct 13, 2026
  2. picnixz commented on Oct 14, 2026

    @picnixz
    Member
  3. added
    pendingThe issue will be closed if no feedback is provided
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is provided

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions