FA-9266 / Build systems / Open access
Compiler option precedence: Disabled warnings remain active · case 01
Disabled warnings remain active.
ROOT CAUSE
The implementation substitutes True for x not in disabled, so disabled warnings remain active.
THE FAILURE
The implementation substitutes True for x not in disabled, so disabled warnings remain active.
Unsuccessful approach: The attempted repair substitutes x in disabled. Fixture 2 still yields ['-Wall', '-O2', '-g'] instead of ['-Ifoo', '-Ifoo', '-O2', '-g'].
Case contract
Append defaults, replace optimization options by the last requested optimization, preserve repeated include options, remove explicitly disabled warnings, and append mandatory flags exactly once.
Why this case matters
An offline model of compiler option precedence, suitable for testing build and release tooling without external services.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(defaults, requested, disabled, mandatory):
flags = list(defaults) + list(requested)
opts = [x for x in flags if x.startswith('-O')]
flags = [x for x in flags if not x.startswith('-O')]
flags = [x for x in flags if True]
if opts: flags.append(opts[-1])
for flag in mandatory:
if flag not in flags: flags.append(flag)
return flags
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], [], [], []), [])
check('fixture 2', solve(['-O0', '-Wall'], ['-O2', '-Ifoo', '-Ifoo'], ['-Wall'], ['-g']), ['-Ifoo', '-Ifoo', '-O2', '-g'])
check('fixture 3', solve(['-O1'], ['-O3'], [], []), ['-O3'])
check('fixture 4', solve(['-g'], [], [], ['-g']), ['-g'])
check('fixture 5', solve(['-Wa', '-Wb'], [], ['-Wa'], []), ['-Wb'])
check('fixture 6', solve([], ['-Ifoo', '-Ibar'], [], ['-g', '-g']), ['-Ifoo', '-Ibar', '-g'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | ['-Wall', '-Ifoo', '-Ifoo', '-O2', '-g'] | ['-Ifoo', '-Ifoo', '-O2', '-g'] | Failed |
| fixture 3 | ['-O3'] | ['-O3'] | Passed |
| fixture 4 | ['-g'] | ['-g'] | Passed |
| fixture 5 | ['-Wa', '-Wb'] | ['-Wb'] | Failed |
| fixture 6 | ['-Ifoo', '-Ibar', '-g'] | ['-Ifoo', '-Ibar', '-g'] | Passed |
SHA-256 / ea879c6a7ec51e8186ff823bc91c2b5be3dfb72eff22af58d52cfa2ab63f419a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(defaults, requested, disabled, mandatory):
flags = list(defaults) + list(requested)
opts = [x for x in flags if x.startswith('-O')]
flags = [x for x in flags if not x.startswith('-O')]
flags = [x for x in flags if x in disabled]
if opts: flags.append(opts[-1])
for flag in mandatory:
if flag not in flags: flags.append(flag)
return flags
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([], [], [], []), [])
check('fixture 2', solve(['-O0', '-Wall'], ['-O2', '-Ifoo', '-Ifoo'], ['-Wall'], ['-g']), ['-Ifoo', '-Ifoo', '-O2', '-g'])
check('fixture 3', solve(['-O1'], ['-O3'], [], []), ['-O3'])
check('fixture 4', solve(['-g'], [], [], ['-g']), ['-g'])
check('fixture 5', solve(['-Wa', '-Wb'], [], ['-Wa'], []), ['-Wb'])
check('fixture 6', solve([], ['-Ifoo', '-Ibar'], [], ['-g', '-g']), ['-Ifoo', '-Ibar', '-g'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | ['-Wall', '-O2', '-g'] | ['-Ifoo', '-Ifoo', '-O2', '-g'] | Failed |
| fixture 3 | ['-O3'] | ['-O3'] | Passed |
| fixture 4 | ['-g'] | ['-g'] | Passed |
| fixture 5 | ['-Wa'] | ['-Wb'] | Failed |
| fixture 6 | ['-g'] | ['-Ifoo', '-Ibar', '-g'] | Failed |
SHA-256 / b7eff9cf7fc0b83d3a70d6c4c4107dc5593bb45774213a108d1621c99fe4488c
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:28.606971+00:00.
Case digest / 9fd158a01425b2a032bb0bd2850ed8accc0c396b29efca59d48cf682806b7f3a