Skip to content

Commit a41ca9e

Browse files
TylerMSFTTylerMSFT
authored andcommitted
edits
1 parent 5021c61 commit a41ca9e

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

docs/overview/compiler-versions.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ helpviewer_keywords: ["Visual C++, platforms supported", "platforms [C++]"]
1010

1111
The Microsoft Visual C++ compiler version consists of four fields:
1212

13-
M - major version (two digits)\
14-
N - minor version (two digits)\
15-
B - build version (five digits)\
16-
R - revision version
17-
13+
M - major version (two digits)\
14+
N - minor version (two digits)\
15+
B - build version (five digits)\
16+
R - revision version
17+
1818
Microsoft-specific compiler macros encode these fields as follows:
1919

20-
`_MSC_VER = MMNN`\
21-
`_MSC_FULL_VER = MMNNBBBBB`\
22-
`_MSC_BUILD = R`
20+
`_MSC_VER` = MMNN\
21+
`_MSC_FULL_VER` = MMNNBBBBB\
22+
`_MSC_BUILD` = R
2323

2424
For example, the compiler version for Visual Studio 2022 version 17.9.0 is 19.39.33519. In this case:
2525
- The major version is 19
2626
- The minor version is 39
2727
- The build version is 33519
2828
- The revision version is 0
2929

30-
The macros reflect these values as `_MSC_VER = 1939`, `_MSC_FULL_VER = 193933519` and `_MSC_BUILD` (the revision) is 0.
30+
The macros reflect these values like so: `_MSC_VER = 1939`, `_MSC_FULL_VER = 193933519` and `_MSC_BUILD` (the revision) is 0.
3131

32-
Note: Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER` instead as described in [Service releases starting with Visual Studio 2017](#service-releases-starting-with-visual-studio-2017). The same is true for distinguishing Visual Studio 2019 16.10 from 16.11.
32+
Note: Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`), as do Visual Studio 2019 16.10 from 16.11. To distinguish them, use `_MSC_FULL_VER` as described in [Service releases starting with Visual Studio 2017](#service-releases-starting-with-visual-studio-2017).
3333

3434
How these fields change to distinguish between different versions of the compiler varies, as described in the following sections.
3535

@@ -40,7 +40,7 @@ How these fields change to distinguish between different versions of the compile
4040
- For major releases, `_MSC_VER` increases by 100. `_MSC_FULL_VER` increases by 10,000,000.
4141
- For minor releases, `_MSC_VER` increases by 10. `_MSC_FULL_VER` increases by 1,000,000.
4242

43-
Note: Visual Studio .NET 2003 was considered a minor release.
43+
Note: Visual Studio .NET 2003 was considered a minor release.
4444

4545
### Visual Studio 2017 and later
4646

@@ -51,7 +51,7 @@ Note: Visual Studio .NET 2003 was considered a minor release.
5151

5252
- Servicing releases can be distinguished using `_MSC_FULL_VER`. The build field (the BBBBB in the MMNNBBBBB version number) typically increases by 1.
5353

54-
For example, two cases where `_MSC_FULL_VER` is useful is to distinguish between Visual Studio 2019 16.8 and 16.9, as well as Visual Studio 2019 16.10 and 16.11. That's because those versions share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`.
54+
For example, two cases where `_MSC_FULL_VER` is useful is to distinguish between Visual Studio 2019 16.8 from 16.9, and Visual Studio 2019 16.10 from 16.11. That's because those versions share the same major and minor versions (and consequently have the same value for `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`.
5555

5656
## Version macros
5757

@@ -62,13 +62,14 @@ N - minor version (two digits)\
6262
B - build version (five digits)\
6363
R - revision version
6464

65-
[`_MSC_VER`](../preprocessor/predefined-macros.md) distinguishes between different versions of the compiler at a high level. Use it to distinguish between major and minor releases. `_MSC_VER = MMNN`.
65+
**[`_MSC_VER`](../preprocessor/predefined-macros.md)** distinguishes between different versions of the compiler at a high level. It is of the form `_MSC_VER` = MMNN. Use it to distinguish between major and minor releases.
66+
67+
**[`_MSC_FULL_VER`](../preprocessor/predefined-macros.md)** represents the major, minor, and build version of the compiler. It is of the form `_MSC_FULL_VER` = MMNNBBBBB. Use it to distinguish between different versions of the compiler, including servicing releases. Because Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and consequently have the same value for `_MSC_VER`), distinguish them using `_MSC_FULL_VER`. The same is true for Visual Studio 2019 16.10 and 16.11.
6668

67-
[`_MSC_FULL_VER`](../preprocessor/predefined-macros.md) represents the major, minor, and build version of the compiler. That is, `_MSC_FULL_VER = MMNNBBBBB`. Use it to distinguish between different versions of the compiler, including servicing releases. Because Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`), distinguish them using `_MSC_FULL_VER`. The same is true for Visual Studio 2019 16.10 and 16.11.
69+
**[`_MSC_BUILD`](../preprocessor/predefined-macros.md)** represents the build version of the compiler. It is of the form `_MSC_BUILD` = R. Use it to distinguish between servicing releases.
6870

69-
[`_MSC_BUILD`](../preprocessor/predefined-macros.md) represents the build version of the compiler. `_MSC_BUILD = R`. Use it to distinguish between servicing releases.
71+
When the major version changed between Visual Studio 2013 and Visual Studio 2015, `_MSC_VER` reflected the change by going from 1800 to 1900.
7072

71-
When the major version changed between Visual Studio 2013 and Visual Studio 2015, `_MSC_VER` reflected the change by going from 1800 to 1900.\
7273
An example of a minor change is from Visual Studio 2022 17.1 to Visual Studio 2022 17.2. In that case, `_MSC_VER` changed from 1931 to 1932.
7374

7475
The following table lists the Visual C++ compiler `_MSC_VER` for each Visual Studio release:
@@ -113,9 +114,9 @@ The following table lists the Visual C++ compiler `_MSC_VER` for each Visual Stu
113114
| Visual Studio 2022 version 17.9 | 1939 |
114115
| Visual Studio 2022 version 17.10 | 1940 |
115116

116-
<sup>a</sup> Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.8 is 192829333. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.9 is 192829910.
117+
<sup>a</sup> Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and consequently have the same value for `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.8 is 192829333. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.9 is 192829910.
117118

118-
<sup>b</sup> Visual Studio 2019 16.10 and 16.11 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.10 is 192929917. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.11 is 192930129.
119+
<sup>b</sup> Visual Studio 2019 16.10 and 16.11 share the same major and minor versions (and consequently have the same value for `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.10 is 192929917. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.11 is 192930129.
119120

120121
## See also
121122

docs/preprocessor/predefined-macros.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,14 @@ MSVC supports other predefined macros:
240240
241241
- `_MANAGED` Defined as 1 when the [`/clr`](../build/reference/clr-common-language-runtime-compilation.md) compiler option is set. Otherwise, undefined.
242242
243-
- `_MSC_BUILD` Defined as an integer literal that contains the revision number element of the compiler's version number. The revision number is the fourth element of the period-delimited version number. For example, if the version number of the Microsoft C/C++ compiler is 15.00.20706.01, the `_MSC_BUILD` macro evaluates to 1. This macro is always defined.
243+
- `_MSC_BUILD` Defined as an integer literal that contains the revision number element of the compiler's version number. The revision number is the last element of the period-delimited version number. For example, if the version number of the Microsoft C/C++ compiler is 15.00.20706.01, the `_MSC_BUILD` macro evaluates to 1. This macro is always defined.
244244
245245
- `_MSC_EXTENSIONS` Defined as 1 if the on-by-default [**`/Ze`** (Enable Language Extensions)](../build/reference/za-ze-disable-language-extensions.md) compiler option is set. Otherwise, undefined.
246246
247247
- `_MSC_FULL_VER` Defined as an integer literal that encodes the major, minor, and build number elements of the compiler's version number. The major number is the first element of the period-delimited version number, the minor number is the second element, and the build number is the third element. For example, if the Microsoft C/C++ compiler version is 19.39.33519, `_MSC_FULL_VER` evaluates to 193933519. Enter `cl /?` at the command line to view the compiler's version number. This macro is always defined.\
248+
248249
Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for 16.8 is 192829333. The minimum value of `_MSC_FULL_VER` for 16.9 is 192829910.\
250+
249251
Visual Studio 2019 16.10 and 16.11 also share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for 16.10 is 192929917. The minimum value of `_MSC_FULL_VER` for 16.11 is 192930129.
250252
251253
- `_MSC_VER` Defined as an integer literal that encodes the major and minor number elements of the compiler's version number. The major number is the first element of the period-delimited version number and the minor number is the second element. For example, if the version number of the Microsoft C/C++ compiler is 17.00.51106.1, the `_MSC_VER` macro evaluates to 1700. Enter `cl /?` at the command line to view the compiler's version number. This macro is always defined.
@@ -264,8 +266,9 @@ MSVC supports other predefined macros:
264266
#endif
265267
```
266268

267-
To test for compiler versions that share major and minor numbers, use the major, minor, and build numbers in `_MSC_FULL_VER` for comparisons. `_MSC_FULL_VER` for Visual Studio 2019 16.8 is 192829333. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.9 is 192829910.
268-
Visual Studio 2019 16.10 and 16.11 also share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.10 is 192929917. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.11 is 192930129.
269+
Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and consequently have the same value for `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.8 is 192829333. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.9 is 192829910.
270+
271+
Visual Studio 2019 16.10 and 16.11 share the same major and minor versions (and consequently have the same value for `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.10 is 192929917. The minimum value of `_MSC_FULL_VER` for Visual Studio 2019 16.11 is 192930129.
269272

270273
For more information about compiler versioning, see [Visual C++ Compiler Version](https://devblogs.microsoft.com/cppblog/visual-c-compiler-version/) in the Microsoft C++ Team Blog.
271274

0 commit comments

Comments
 (0)