Skip to content

Commit d7618f9

Browse files
TylerMSFTTylerMSFT
authored andcommitted
tech review
1 parent dc3d1a4 commit d7618f9

File tree

1 file changed

+41
-14
lines changed

1 file changed

+41
-14
lines changed

docs/overview/compiler-versions.md

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,68 @@
11
---
22
description: "Learn more about Microsoft Visual C++ compiler versioning."
3-
title: "Microsoft Visual C++ compiler versions (Visual C++)"
3+
title: "Microsoft Visual C++ compiler versioning (Visual C++)"
44
ms.date: 02/13/2024
55
ms.service: "visual-cpp"
66
ms.subservice: "tools"
77
helpviewer_keywords: ["Visual C++, platforms supported", "platforms [C++]"]
88
---
9-
# Microsoft Visual C++ compiler versions
9+
# Microsoft Visual C++ compiler versioning
1010

11-
The Microsoft Visual C++ compiler version consists of a four-part major and minor version number. The compiler version is reflected in the [`_MSC_VER`](../preprocessor/predefined-macros.md) macro as a number, such as 1938. It is used to distinguish between different versions of the compiler.
11+
The Microsoft Visual C++ compiler version consists of four fields. They are reflected in various Microsoft-specific compiler macros that can be used to distinguish which version of the compiler is compiling your code.
12+
13+
The version number consists of four fields:
14+
15+
M - major version (2 digits)\
16+
m - minor version (2 digits)\
17+
B - build version (4 digits)\
18+
R - revision version
19+
20+
Microsoft-specific compiler macros encode these fields as follows:
21+
22+
`_MSC_VER` = MMmm
23+
`_MSC_FULL_VER` = MMmmBBBB
24+
`_MSC_BUILD` = R
25+
26+
For example, for Visual Studio 2022 version 17.9.0, the compiler version is 19.39.33519. The major version is 19, the minor version is 39, the build version is 33519, and the revision version is 0. In other words, `_MSC_VER` is 1939, `_MSC_FULL_VER` is 193933519, and `_MSC_BUILD` (the revision) is 0.
27+
28+
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 and 16.11.
29+
30+
How these fields change to distinguish between different versions of the compiler varies, as described in the following sections.
1231

1332
## A brief history of Visual C++ compiler versioning
1433

1534
### Visual Studio 6.0 through Visual Studio 2015 (14.0)
1635

17-
- For major releases, `_MSC_VER` increases by 100. `_MSC_FULL_VER` increases by 10,000,000.
36+
- For major releases, `_MSC_VER` increases by 100. `_MSC_FULL_VER` increases by 10,000,000.
1837
- For minor releases, `_MSC_VER` increases by 10. `_MSC_FULL_VER` increases by 1,000,000.
1938

2039
Note: Visual Studio .NET 2003 was considered a minor release.
2140

22-
### Visual Studio 2017
41+
### Visual Studio 2017 and later
2342

2443
- For major releases, the minor version increases by 10.
25-
- Starting with Visual Studio 2017 version 15.3, the minor version increases by 1.
44+
- For minor releases, the minor version increases by 1 starting with Visual Studio 2017 version 15.3.
2645

2746
### Service releases starting with Visual Studio 2017
2847

29-
- Distinguish servicing releases using `_MSC_FULL_VER`. The build field (the third element of the period-delimited version number) typically increases by 1.
30-
- 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. The same is true for distinguishing Visual Studio 2019 16.10 and 16.11.
48+
- Servicing releases can be distinguished using `_MSC_FULL_VER`. The build field (the BBBB in the MMmmBBBB version number) typically increases by 1.
49+
50+
For example, two cases where `_MSC_FULL_VER` is particularly useful is to distinguish between Visual Studio 2019 16.8 and 16.9, as well as Visual Studio 2019 16.10 and 16.11. The reason is that those versions share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`.
3151

3252
## Version macros
3353

34-
- [`_MSC_VER`](../preprocessor/predefined-macros.md) distinguishes between different versions of the compiler at a high level. It's used to distinguish between major and minor releases.
35-
- [`_MSC_FULL_VER`](../preprocessor/predefined-macros.md) represents the major, minor, and build version of the compiler. It's used to distinguish between different versions of the compiler, including servicing releases. 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 same is true for Visual Studio 2019 16.10 and 16.11.
36-
- [`_MSC_BUILD`](../preprocessor/predefined-macros.md) represents the build version of the compiler. Use it to distinguish between servicing releases.
54+
Recall that the version number consists of four fields:
55+
56+
M - major version (2 digits)\
57+
m - minor version (2 digits)\
58+
B - build version (4 digits)\
59+
R - revision version
60+
61+
- [`_MSC_VER`](../preprocessor/predefined-macros.md) distinguishes between different versions of the compiler at a high level. It's used to distinguish between major and minor releases. `_MSC_VER` = MMmm.
62+
- [`_MSC_FULL_VER`](../preprocessor/predefined-macros.md) represents the major, minor, and build version of the compiler. `_MSC_FULL_VER` = MMmmBBBB. It's used to distinguish between different versions of the compiler, including servicing releases. 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 same is true for Visual Studio 2019 16.10 and 16.11.
63+
- [`_MSC_BUILD`](../preprocessor/predefined-macros.md) represents the build version of the compiler. `_MSC_BUILD` = R.Use it to distinguish between servicing releases.
3764

38-
For example, the major version changed between Visual Studio 2013 and Visual Studio 2015, reflected by a change in `_MSC_VER` from 1800 to 1900. An example of a minor change is from 17.1 to 17.2, when `_MSC_VER` changed from 1931 to 1932.
65+
For example, the major version changed between Visual Studio 2013 and Visual Studio 2015, reflected by a change in `_MSC_VER` from 1800 to 1900. An example of a minor change is from Visual Studio 2022 17.1 to Visual Studio 2022 17.2, when `_MSC_VER` changed from 1931 to 1932.
3966

4067
The following table lists the Visual C++ compiler `_MSC_VER` for each Visual Studio release:
4168

@@ -79,9 +106,9 @@ The following table lists the Visual C++ compiler `_MSC_VER` for each Visual Stu
79106
| Visual Studio 2022 version 17.9 | 1939 |
80107
| Visual Studio 2022 version 17.10 | 1940 |
81108

82-
<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`. `MSC_FULL_VER` for 16.8 is 192829333. `MSC_FULL_VER` for 16.9 is 192829913.
109+
<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`. `_MSC_FULL_VER` for 16.8 is 192829333. `_MSC_FULL_VER` for 16.9 is 192829910.
83110

84-
<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`. `MSC_FULL_VER` for 16.10 is ???. `MSC_FULL_VER` for 16.11 is 192930133.
111+
<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`. `_MSC_FULL_VER` for 16.10 is 192933037. `_MSC_FULL_VER` for 16.11 is 192930133.
85112

86113
## See also
87114

0 commit comments

Comments
 (0)