Bug 21940 – Compiler flags -check=on/off not recognized
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-20T19:07:27Z
Last change time
2021-05-30T03:01:47Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel
Comments
Comment #0 by moonlightsentinel — 2021-05-20T19:07:27Z
The help page for the -check=... flag lists on/off as a convenient shortcut to enable/disable all checks:
dmd -check=?
Enable or disable specific checks:
=[h|help|?] List information on all available choices
=assert[=[on|off]] Assertion checking
=bounds[=[on|off]] Array bounds checking
=in[=[on|off]] Generate In contracts
=invariant[=[on|off]] Class/struct invariants
=out[=[on|off]] Out contracts
=switch[=[on|off]] Final switch failure checking
=on Enable all assertion checking
(default for non-release builds)
=off Disable all assertion checking
But those options are not recognized:
dmd -check=on
Error: Switch `-check=on` is invalid
dmd -check=off
Error: Switch `-check=off` is invalid
Comment #1 by dlang-bot — 2021-05-20T19:11:38Z
@MoonlightSentinel created dlang/dmd pull request #12548 "Fix 21940 - Recognize on/off as valid options for -check" fixing this issue:
- Fix 21940 - Recognize on/off as valid options for -check
Check for the special values `"on"` and `"off"` before parsing
`<option>=<state>`.
https://github.com/dlang/dmd/pull/12548
Comment #2 by dlang-bot — 2021-05-20T23:21:49Z
dlang/dmd pull request #12548 "Fix 21940 - Recognize on/off as valid options for -check" was merged into stable:
- 7fb9accd947edf98e53093b2d37cad650e0b5828 by MoonlightSentinel:
Fix 21940 - Recognize on/off as valid options for -check
Check for the special values `"on"` and `"off"` before parsing
`<option>=<state>`.
https://github.com/dlang/dmd/pull/12548
Comment #3 by dlang-bot — 2021-05-30T03:01:47Z
dlang/dmd pull request #12600 "merge stable" was merged into master:
- fea011ecb74ca6f9a9124980e3ec0c9c60a5f7e3 by MoonlightSentinel:
Fix 21940 - Recognize on/off as valid options for -check
Check for the special values `"on"` and `"off"` before parsing
`<option>=<state>`.
https://github.com/dlang/dmd/pull/12600