D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21940 - Compiler flags -check=on/off not recognized
Summary: Compiler flags -check=on/off not recognized
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-05-20 19:07 UTC by moonlightsentinel
Modified: 2021-05-30 03:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2021-05-20 19:07:27 UTC
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 Dlang Bot 2021-05-20 19:11:38 UTC
@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 Dlang Bot 2021-05-20 23:21:49 UTC
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 Dlang Bot 2021-05-30 03:01:47 UTC
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