description | title | ms.date | f1_keywords | helpviewer_keywords | ||
---|---|---|---|---|---|---|
Learn more about: /options:strict (Unrecognized compiler options are errors) |
/options:strict (Unrecognized compiler options are errors) |
12/15/2021 |
|
|
The /options:strict
compiler option tells the compiler to return an error code if a compiler option isn't recognized.
/options:strict
The /options:strict
compiler option causes the compiler driver cl.exe to exit with an error code after all command-line options are parsed if another command-line option or argument isn't recognized. The compiler emits error D8043 for any command-line option or argument that isn't recognized.
The /options:strict
option is available starting in Visual Studio 2022 version 17.0. In earlier versions of the compiler, or if /options:strict
isn't specified, the compiler doesn't exit on an unrecognized option. It emits warning D9002, ignores the unrecognized option, and continues processing.
-
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
-
Select the Configuration Properties > C/C++ > Command Line property page.
-
Add
/options:strict
to the Additional options: pane.