Skip to content

Commit 046fa0b

Browse files
authored
Merge pull request #3133 from corob-msft/docs/corob/20200501-Elnar-mail
Update preprocessor content per Elnar mail
2 parents 0d3595d + 9bb5109 commit 046fa0b

10 files changed

+74
-36
lines changed

docs/build/reference/experimental-preprocessor.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
---
22
title: "/experimental:preprocessor (Enable preprocessor conformance mode)"
33
description: "Use the /experimental:preprocessor compiler option to enable experimental compiler support for a standard conforming preprocessor."
4-
ms.date: "10/31/2019"
4+
ms.date: 09/10/2020
55
f1_keywords: ["preprocessor", "/experimental:preprocessor"]
66
helpviewer_keywords: ["preprocessor conformance", "/experimental:preprocessor", "Enable preprocessor conformance mode"]
77
---
8-
# /experimental:preprocessor (Enable preprocessor conformance mode)
8+
# `/experimental:preprocessor` (Enable preprocessor conformance mode)
99

10-
This option enables an experimental, token-based preprocessor that more closely conforms to C++11 standards, including C99 preprocessor features. For more information, see [MSVC experimental preprocessor overview](../../preprocessor/preprocessor-experimental-overview.md).
10+
This option is obsolete starting in Visual Studio 2019 version 16.5, replaced by the [`/Zc:preprocessor`](zc-preprocessor.md) compiler option. **`/experimental:preprocessor`** enables an experimental, token-based preprocessor that more closely conforms to C++11 standards, including C99 preprocessor features. For more information, see [MSVC new preprocessor overview](../../preprocessor/preprocessor-experimental-overview.md).
1111

1212
## Syntax
1313

14-
> **/experimental:preprocessor**[**-**]
14+
> **`/experimental:preprocessor`**\[**`-`**]
1515
1616
## Remarks
1717

18-
Use the **/experimental:preprocessor** compiler option to enable the experimental conforming preprocessor. You can use **/experimental:preprocessor-** option to explicitly specify the traditional preprocessor.
18+
Use the **`/experimental:preprocessor`** compiler option to enable the experimental conforming preprocessor. You can use **`/experimental:preprocessor-`** option to explicitly specify the traditional preprocessor.
1919

20-
The **/experimental:preprocessor** option is available starting in Visual Studio 2017 version 15.8.
20+
The **`/experimental:preprocessor`** option is available starting in Visual Studio 2017 version 15.8. Starting in Visual Studio 2019 version 16.5, the new preprocessor is complete, and available under the [`/Zc:preprocessor`](zc-preprocessor.md) compiler option.
2121

2222
### To set this compiler option in the Visual Studio development environment
2323

2424
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).
2525

2626
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
2727

28-
1. Modify the **Additional Options** property to include **/experimental:preprocessor** and then choose **OK**.
28+
1. Modify the **Additional Options** property to include *`/experimental:preprocessor`* and then choose **OK**.
2929

3030
## See also
3131

docs/build/reference/zc-conformance.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "/Zc (Conformance)"
3-
ms.date: "03/06/2018"
3+
description: "The /Zc conformance compiler options enable or disable support for conforming or backward-compatible behavior."
4+
ms.date: 09/10/2020
45
helpviewer_keywords: ["/Zc compiler options [C++]", "-Zc compiler options [C++]", "Conformance compiler options", "Zc compiler options [C++]"]
56
ms.assetid: db1cc175-6e93-4a2e-9396-c3725d2d8f71
67
---
@@ -28,6 +29,7 @@ These are the **`/Zc`** compiler options:
2829
| [`/ZcimplicitNoexcept`](zc-implicitnoexcept-implicit-exception-specifiers.md) | Enable implicit **`noexcept`** on required functions (on by default). |
2930
| [`/Zc:inline`](zc-inline-remove-unreferenced-comdat.md) | Remove unreferenced function or data if it is COMDAT or has internal linkage only (off by default). |
3031
| [`/Zc:noexceptTypes`](zc-noexcepttypes.md) | Enforce C++17 **`noexcept`** rules (on by default in C++17 or later). |
32+
| [`/Zc:preprocessor`](zc-preprocessor.md) | Use the new conforming preprocessor (off by default, except in C11/C17). |
3133
| [`/Zc:referenceBinding`](zc-referencebinding-enforce-reference-binding-rules.md) | A UDT temporary will not bind to an non-const lvalue reference (off by default). |
3234
| [`/Zc:rvalueCast`](zc-rvaluecast-enforce-type-conversion-rules.md) | Enforce Standard C++ explicit type conversion rules (off by default). |
3335
| [`/Zc:sizedDealloc`](zc-sizeddealloc-enable-global-sized-dealloc-functions.md) | Enable C++14 global sized deallocation functions (on by default). |
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "/Zc:preprocessor (Enable preprocessor conformance mode)"
3+
description: "Use the /Zc:preprocessor compiler option to enable compiler support for a standard conforming preprocessor."
4+
ms.date: 09/10/2020
5+
f1_keywords: ["preprocessor", "/Zc:preprocessor"]
6+
helpviewer_keywords: ["preprocessor conformance", "/Zc:preprocessor", "Enable preprocessor conformance mode"]
7+
---
8+
# `/Zc:preprocessor` (Enable preprocessor conformance mode)
9+
10+
This option enables a token-based preprocessor that conforms to C99 and C++11 and later standards. For more information, see [MSVC new preprocessor overview](../../preprocessor/preprocessor-experimental-overview.md).
11+
12+
## Syntax
13+
14+
> **`/Zc:preprocessor`**[**-**]
15+
16+
## Remarks
17+
18+
Use the **`/Zc:preprocessor`** compiler option to enable the conforming preprocessor. You can use **`/Zc:preprocessor-`** option to explicitly specify the traditional (non-conforming) preprocessor.
19+
20+
The **`/Zc:preprocessor`** option is available starting in Visual Studio 2019 version 16.5. An earlier, incomplete version of the new preprocessor option is available in versions of Visual Studio starting in Visual Studio 2017 version 15.8. For more information, see [`/experimental:preprocessor`](experimental-preprocessor.md).
21+
22+
### To set this compiler option in the Visual Studio development environment
23+
24+
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).
25+
26+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
27+
28+
1. Modify the **Additional Options** property to include *`/Zc:preprocessor`* and then choose **OK**.
29+
30+
## See also
31+
32+
[/Zc (Conformance)](zc-conformance.md)

docs/build/toc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,8 @@
744744
href: ../build/reference/zc-inline-remove-unreferenced-comdat.md
745745
- name: "/Zc:noexceptTypes (C++17 noexcept rules)"
746746
href: ../build/reference/zc-noexcepttypes.md
747+
- name: "/Zc:preprocessor (Enable preprocessor conformance mode)"
748+
href: ../build/reference/zc-preprocessor.md
747749
- name: "/Zc:referenceBinding (Enforce reference binding rules)"
748750
href: ../build/reference/zc-referencebinding-enforce-reference-binding-rules.md
749751
- name: "/Zc:rvalueCast (Enforce type conversion rules)"

docs/overview/cpp-conformance-improvements.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ int main() {
738738
739739
### Preprocessor output preserves newlines
740740
741-
The experimental preprocessor now preserves newlines and whitespace when using **`/P`** or **`/E`** with **`/experimental:preprocessor`**. This change can be disabled by using **`/d1experimental:preprocessor:oldWhitespace`**.
741+
The experimental preprocessor now preserves newlines and whitespace when using **`/P`** or **`/E`** with **`/experimental:preprocessor`**.
742742
743743
Given this example source,
744744

docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "What's new for C++ in Visual Studio"
3+
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
34
ms.date: "05/19/2020"
45
ms.technology: "cpp-ide"
56
ms.assetid: 8801dbdb-ca0b-491f-9e33-01618bff5ae9
@@ -251,7 +252,7 @@ The MSVC compiler toolset in Visual Studio version 15.7 now conforms with the C+
251252

252253
##### Visual Studio 2017 version 15.8
253254

254-
The [`/experimental:preprocessor`](../build/reference/experimental-preprocessor.md) compiler switch enables the new experimental MSVC preprocessor that will eventually conform to all applicable C and C++ standards. For more information, see [MSVC experimental preprocessor overview](../preprocessor/preprocessor-experimental-overview.md).
255+
The [`/experimental:preprocessor`](../build/reference/experimental-preprocessor.md) compiler switch enables the new experimental MSVC preprocessor that will eventually conform to all applicable C and C++ standards. For more information, see [MSVC new preprocessor overview](../preprocessor/preprocessor-experimental-overview.md).
255256

256257
### New compiler options
257258

docs/porting/visual-cpp-porting-and-upgrading-guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Microsoft C++ porting and upgrading guide"
33
description: "Upgrade Microsoft C++ code to the latest version of Visual Studio."
4-
ms.date: "11/18/2019"
4+
ms.date: 09/10/2020
55
ms.assetid: f5fbcc3d-aa72-41a6-ad9a-a706af2166fb
66
ms.topic: "overview"
77
---
@@ -23,7 +23,7 @@ If a legacy application is running satisfactorily, in a secure environment, and
2323

2424
- Build times are faster, because of performance improvements in the compiler and linker.
2525

26-
- Better standards conformance. The [/permissive-](../build/reference/permissive-standards-conformance.md) compiler option helps you identify code that doesn't conform to the current C++ standard.
26+
- Better standards conformance. The [/permissive-](../build/reference/permissive-standards-conformance.md) compiler option helps you identify code that doesn't conform to the current C++ standard. The [new preprocessor](../preprocessor/preprocessor-experimental-overview.md) supports code conformance, too.
2727

2828
- Better run-time security, including more secure [C Runtime library](../c-runtime-library/security-features-in-the-crt.md) features. And, compiler features such as [guard checking](../build/reference/guard-enable-guard-checks.md) and address sanitizers (new in Visual Studio 2019 version 16.4).
2929

docs/preprocessor/c-cpp-preprocessor-reference.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
---
22
title: "C/C++ preprocessor reference"
3-
ms.date: "10/31/2019"
3+
description: "Reference for the Microsoft C/C++ compiler preprocessor in Visual Studio."
4+
ms.date: 09/10/2020
45
helpviewer_keywords: ["preprocessor", "preprocessor, reference overview"]
56
ms.assetid: e4a52843-7016-4f6d-8b40-cb1ace18f805
67
---
78
# C/C++ preprocessor reference
89

910
The *C/C++ preprocessor reference* explains the preprocessor as it is implemented in Microsoft C/C++. The preprocessor performs preliminary operations on C and C++ files before they are passed to the compiler. You can use the preprocessor to conditionally compile code, insert files, specify compile-time error messages, and apply machine-specific rules to sections of code.
1011

11-
In Visual Studio 2019 the [/experimental:preprocessor](../build/reference/experimental-preprocessor.md) compiler option enables a new implementation of the preprocessor. The new implementation is still in progress, and is therefore considered experimental. It is intended to eventually be conformant with C99, C11, and C++20. For more information, see [MSVC experimental preprocessor overview](preprocessor-experimental-overview.md).
12+
In Visual Studio 2019 the [/experimental:preprocessor](../build/reference/experimental-preprocessor.md) compiler option enables a new implementation of the preprocessor. The new implementation is still in progress, and is therefore considered experimental. It is intended to eventually be conformant with C99, C11, and C++20. For more information, see [MSVC new preprocessor overview](preprocessor-experimental-overview.md).
1213

1314
## In this section
1415

1516
[Preprocessor](preprocessor.md)\
16-
Provides an overview of the traditional and new experimental preprocessors.
17+
Provides an overview of the traditional and new conforming preprocessors.
1718

1819
[Preprocessor directives](../preprocessor/preprocessor-directives.md)\
1920
Describes directives, typically used to make source programs easy to change and easy to compile in different execution environments.
@@ -22,7 +23,7 @@ Describes directives, typically used to make source programs easy to change and
2223
Discusses the four preprocessor-specific operators used in the context of the `#define` directive.
2324

2425
[Predefined macros](../preprocessor/predefined-macros.md)\
25-
Discusses predefined macros as specified by ANSI and Microsoft C++.
26+
Discusses predefined macros as specified by the C and C++ standards and by Microsoft C++.
2627

2728
[Pragmas](../preprocessor/pragma-directives-and-the-pragma-keyword.md)\
2829
Discusses pragmas, which offer a way for each compiler to offer machine- and operating system-specific features while retaining overall compatibility with the C and C++ languages.

0 commit comments

Comments
 (0)