Skip to content

Commit ad40b42

Browse files
authored
Merge pull request #3626 from corob-msft/docs/corob/c17-install-fix
16.10 updates to C17 conformance
2 parents adb0bf8 + a365549 commit ad40b42

13 files changed

+105
-110
lines changed

docs/build/reference/std-specify-language-standard-version.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/std (Specify Language Standard Version)"
33
description: "The MSVC compiler option /std specifies the C or C++ language standard supported by the compiler."
4-
ms.date: "5/21/2021"
4+
ms.date: 06/14/2021
55
f1_keywords: ["/std", "-std", "/std:c++14", "/std:c++17", "/std:c11", "/std:c17", "VC.Project.VCCLCompilerTool.CppLanguageStandard"]
66
---
77
# `/std` (Specify Language Standard Version)
@@ -18,7 +18,7 @@ Enable supported C and C++ language features from the specified version of the C
1818
1919
## Remarks
2020

21-
The **`/std`** option is available in Visual Studio 2017 and later. It's used to control the version-specific ISO C or C++ programming language standard features enabled during compilation of your code. This option allows you to disable support for certain new language and library features: ones that may break your existing code that conforms to a particular version of the language standard.
21+
The **`/std`** options are available in Visual Studio 2017 and later. They're used to control the version-specific ISO C or C++ programming language standard features enabled during compilation of your code. The options allow you to disable support for certain new language and library features: ones that may break your existing code that conforms to a particular version of the language standard.
2222

2323
### C++ standards support
2424

@@ -28,7 +28,7 @@ The **`/std`** option in effect during a C++ compilation can be detected by use
2828

2929
Enables C++14 standard-specific features implemented by the MSVC compiler. This option is the default for code compiled as C++. Available starting with Visual Studio 2015 Update 3. Enables C++14 standard-specific features implemented by the MSVC compiler.
3030

31-
This option disables compiler and standard library support for features that are changed or new in more recent versions of the language standard.<br>It doesn't disable some C++17 features already implemented in previous releases of the MSVC compiler. See [Microsoft C++ language conformance table](../../overview/visual-cpp-language-conformance.md) for a list of which C++14 and C++17 features are enabled when you specify **`/std:c++14`**.
31+
This option disables compiler and standard library support for features that are changed or new in more recent versions of the language standard. It doesn't disable some C++17 features already implemented in previous releases of the MSVC compiler. For more information, see [Microsoft C/C++ language conformance](../../overview/visual-cpp-language-conformance.md). It indicates which C++14 and C++17 features are enabled when you specify **`/std:c++14`**.
3232

3333
The following features remain enabled when the **`/std:c++14`** option is specified to avoid breaking changes for users who have already taken dependencies on the features available in or before Visual Studio 2015 Update 2:
3434

@@ -42,20 +42,21 @@ The following features remain enabled when the **`/std:c++14`** option is specif
4242

4343
Enable C++17 standard-specific features and behavior. Enables the full set of C++17 features implemented by the MSVC compiler. This option disables compiler and standard library support for features that are new or changed after C++17. That includes post-C++17 changes in versions of the Working Draft and defect updates of the C++ Standard. Available starting in Visual Studio version 15.3
4444

45-
Depending on the MSVC compiler version or update level, C++17 features may not be fully implemented or fully conforming when you specify the **`/std:c++17`** options. For an overview of C++ language conformance in Visual C++ by release version, see [Microsoft C++ language conformance table](../../overview/visual-cpp-language-conformance.md).
45+
Depending on the MSVC compiler version or update level, C++17 features may not be fully implemented or fully conforming when you specify the **`/std:c++17`** options. For an overview of C++ language conformance in Visual C++ by release version, see [Microsoft C/C++ language conformance](../../overview/visual-cpp-language-conformance.md).
4646

4747
**`/std:c++latest`**
4848

4949
Enable all currently implemented compiler and standard library features proposed for the next draft standard. Available starting with Visual Studio 2015 Update 3
5050

51-
Enables the post-C++17 language and library features currently implemented in the compiler and libraries. These features may include changes from the C++20 Working Draft, defect updates that aren't included in C++17, and experimental proposals for the draft standard.
51+
Enables the post-C++17 language and library features currently implemented in the compiler and libraries. These features may include changes to the latest Working Draft standard, defect updates, and experimental proposals for the standard.
5252

5353
For a list of supported language and library features, see [What's New for Visual C++](../../overview/what-s-new-for-visual-cpp-in-visual-studio.md).
5454

5555
This option doesn't enable features guarded by the **`/experimental`** switch, but may be required to enable them.
5656

5757
> [!NOTE]
5858
> The compiler and library features enabled by **`/std:c++latest`** may appear in a future C++ standard, as well as approved C++20 features. Features that have not been approved are subject to breaking changes or removal without notice and are provided on an as-is basis.
59+
5960
### C standards support
6061

6162
By default, when code is compiled as C, the MSVC compiler doesn't conform to a particular C standard. It implements ANSI C89 with several Microsoft extensions, some of which are part of ISO C99. Some Microsoft extensions can be disabled by using the [`/Za`](za-ze-disable-language-extensions.md) compiler option, but others remain in effect. It isn't possible to specify strict C89 conformance.
@@ -71,9 +72,9 @@ Enable ISO C17 conformance. Available starting in Visual Studio 2019 version 16.
7172
Because the new preprocessor is needed to support these standards, the **`/std:c11`** and **`/std:c17`** compiler options set the [`/Zc:preprocessor`](zc-preprocessor.md) option automatically. If you want to use the traditional (legacy) preprocessor for C11 or C17, you must set the **`/Zc:preprocessor-`** compiler option explicitly. Setting the **`/Zc:preprocessor-`** option may lead to unexpected behavior, and isn't recommended.
7273

7374
> [!NOTE]
74-
> At the time of release, the latest Windows SDK and UCRT libraries do not yet support C11 and C17 code. A pre-release version of the Windows SDK and UCRT is required. For more information and installation instructions, see [Install C11 and C17 support in Visual Studio](../../overview/install-c17-support.md).
75+
> At the time of release, the Windows SDK and UCRT libraries installed by Visual Studio don't support C11 and C17 code ywt. An updated version of the Windows SDK and UCRT is required. For more information and installation instructions, see [Install C11 and C17 support in Visual Studio](../../overview/install-c17-support.md).
7576
76-
When you specify **`/std:c11`** or **`/std:c17`**, MSVC supports all the required features of C11 and C17. The compiler options enable support for these functionalities:
77+
When you specify **`/std:c11`** or **`/std:c17`**, MSVC supports all the features of C11 and C17 required by the standard. (Certain optional features aren't supported.) The compiler options enable support for these functionalities:
7778

7879
- [`_Pragma`](../../preprocessor/pragma-directives-and-the-pragma-keyword.md#the-_pragma-preprocessing-operator-c99-c11)
7980

@@ -89,27 +90,29 @@ When you specify **`/std:c11`** or **`/std:c17`**, MSVC supports all the require
8990

9091
The IDE uses C settings for IntelliSense and code highlighting when your source files have a *`.c`* file extension, or when you specify the [`/TC`](tc-tp-tc-tp-specify-source-file-type.md) compiler option. Currently, IntelliSense highlighting is only available for keywords, and not the macros introduced by the standard headers.
9192

92-
Since C17 is largely a bug fix release of ISO C11, MSVC support for C11 already includes all the relevant defect reports. At present, there are no differences between the C11 and C17 versions except for the `__STDC_VERSION__` macro. It expands to `201112L` for C11, and `201710L` for C17.
93+
Since C17 is largely a bug fix release of ISO C11, MSVC support for C11 already includes all the relevant defect reports. There are no differences between the C11 and C17 versions except for the `__STDC_VERSION__` macro. It expands to `201112L` for C11, and `201710L` for C17.
9394

94-
The compiler doesn't support any optional features of ISO C11. Several of these optional features of C11 were required features of C99 that MSVC hasn't implemented for architectural reasons. You can use the feature test macros such as `__STDC_NO_VLA__` to detect compiler support levels for individual features. For more information about C-specific predefined macros, see [Predefined macros](../../preprocessor/predefined-macros.md).
95+
The compiler doesn't support most optional features of ISO C11. Several of these optional features of C11 were required features of C99 that MSVC hasn't implemented for architectural reasons. You can use the feature test macros such as `__STDC_NO_VLA__` to detect compiler support levels for individual features. For more information about C-specific predefined macros, see [Predefined macros](../../preprocessor/predefined-macros.md).
9596

9697
- There's no conforming multithreading, atomic, or complex number support in the Visual Studio 2019 version 16.8 release.
9798

9899
- `aligned_alloc` support is missing, because of the Windows heap implementation. The alternative is to use [`_aligned_malloc`](../../c-runtime-library/reference/aligned-malloc.md).
99100

100101
- DR 400 support is currently unimplemented for `realloc`, because this change would break the ABI.
101102

102-
- Variable length array (VLA) support isn't planned. Variable length arrays are often less efficient than comparable fixed sized arrays. They're also inefficient compared to equivalent heap memory allocations, when safely and securely implemented. VLAs provide attack vectors comparable to `gets()`, which is deprecated and planned for removal.
103+
- Variable length array (VLA) support isn't planned. VLAs provide attack vectors comparable to `gets()`, which is deprecated and planned for removal.
104+
105+
For more information, see the C Standard library features section of [Microsoft C/C++ language conformance](../../overview/visual-cpp-language-conformance.md).
103106

104107
### To set this compiler option in the Visual Studio development environment
105108

106-
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
109+
1. Open the project's **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
107110

108111
1. Select the **Configuration Properties** > **C/C++** > **Language** property page.
109112

110113
1. In **C++ Language Standard** (or for C, **C Language Standard**), choose the language standard to support from the dropdown control, then choose **OK** or **Apply** to save your changes.
111114

112115
## See also
113116

114-
[MSVC Compiler Options](compiler-options.md)<br/>
115-
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
117+
[MSVC compiler options](compiler-options.md)<br/>
118+
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)

0 commit comments

Comments
 (0)