Skip to content

Commit f658991

Browse files
authored
Merge branch 'live' into master
2 parents a20070c + 0025b2d commit f658991

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

docs/build/reference/debug-generate-debug-info.md

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ The linker puts the debugging information into a program database (PDB) file. It
5757

5858
An executable (.exe file or DLL) created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension .pdb to name the program database, and embeds the path where it was created. To override this default, set [/PDB](../../build/reference/pdb-use-program-database.md) and specify a different file name.
5959

60-
The **/DEBUG:FASTLINK** option is the linker default for debug builds in Visual Studio 2017, set when you specify /DEBUG with no additional options. This option leaves private symbol information in the individual compilation products used to build the executable. It generates a limited PDB that indexes into the debug information in the object files and libraries used to build the executable instead of making a full copy. This option can link from two to four times as fast as full PDB generation, and is recommended when you are debugging locally and have the build products available. This limited PDB can't be used for debugging when the required build products are not available, such as when the executable is deployed on another computer. In a developer command prompt, you can use the mspdbcmf.exe tool to generate a full PDB from this limited PDB. In Visual Studio, use the Project or Build menu items for generating a full PDB file to create a full PDB for the project or solution.
60+
The **/DEBUG:FASTLINK** option leaves private symbol information in the individual compilation products used to build the executable. It generates a limited PDB that indexes into the debug information in the object files and libraries used to build the executable instead of making a full copy. This option can link from two to four times as fast as full PDB generation, and is recommended when you are debugging locally and have the build products available. This limited PDB can't be used for debugging when the required build products are not available, such as when the executable is deployed on another computer. In a developer command prompt, you can use the mspdbcmf.exe tool to generate a full PDB from this limited PDB. In Visual Studio, use the Project or Build menu items for generating a full PDB file to create a full PDB for the project or solution.
6161

62-
The **/DEBUG:FULL** option is the linker default for debug builds in Visual Studio 2015, set when you specify /DEBUG with no additional options. This option moves all private symbol information from individual compilation products (object files and libraries) into a single PDB, and can be the most time-consuming part of the link. However, the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed.
62+
The **/DEBUG:FULL** option moves all private symbol information from individual compilation products (object files and libraries) into a single PDB, and can be the most time-consuming part of the link. However, the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed.
6363

64-
The **/DEBUG:NONE** option does not generate a PDB, and is the linker default for release builds.
64+
The **/DEBUG:NONE** option does not generate a PDB.
65+
66+
When you specify **/DEBUG** with no additional options, the linker defaults to **/DEBUG:FULL** for command line and makefile builds, for release builds in the Visual Studio IDE, and for both debug and release builds in Visual Studio 2015 and earlier versions. Beginning in Visual Studio 2017, the build system in the IDE defaults to **/DEBUG:FASTLINK** when you specify the **/DEBUG** option for debug builds. Other defaults are unchanged to maintain backward compatibility.
6567

6668
The compiler's [C7 Compatible](../../build/reference/z7-zi-zi-debug-information-format.md) (/Z7) option causes the compiler to leave the debugging information in the .obj files. You can also use the [Program Database](../../build/reference/z7-zi-zi-debug-information-format.md) (/Zi) compiler option to store the debugging information in a PDB for the .obj file. The linker looks for the object's PDB first in the absolute path written in the .obj file, and then in the directory that contains the .obj file. You cannot specify an object's PDB file name or location to the linker.
6769

@@ -89,4 +91,4 @@ It is not possible to create an .exe or .dll that contains debug information. De
8991

9092
## See Also
9193
[Setting Linker Options](../../build/reference/setting-linker-options.md)
92-
[Linker Options](../../build/reference/linker-options.md)
94+
[Linker Options](../../build/reference/linker-options.md)

docs/cpp/string-and-i-o-formatting-modern-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ translation.priority.ht:
3333
# String and I/O Formatting (Modern C++)
3434
C++ [iostreams](../standard-library/iostream.md) are capable of formatted string I/O. For example, the following code shows how to set cout to format an integer to output in hexadecimal, first saving off the current state and re-setting afterwards, because once state formatting is passed to cout, it stays that way until changed, not just for the one line of code.
3535

36-
```fortran
36+
```cpp
3737
#include <iostream>
3838
#include <iomanip>
3939

@@ -89,4 +89,4 @@ int main() 
8989
[C++ Standard Library](../standard-library/cpp-standard-library-reference.md)
9090
[\<iostream>](../standard-library/iostream.md)
9191
[\<limits>](../standard-library/limits.md)
92-
[\<iomanip>](../standard-library/iomanip.md)
92+
[\<iomanip>](../standard-library/iomanip.md)

docs/error-messages/compiler-errors-2/compiler-error-c2603.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,26 @@ translation.priority.ht:
3434
- "zh-cn"
3535
- "zh-tw"
3636
---
37-
# Compiler Error C2603
38-
'function' : Too many block scope static objects with constructor/destructors in function
37+
# Compiler Error C2603
3938

40-
There is a limit of 31 on the number of static objects you can have in an externally visible inline function.
39+
> '*function*' : Too many block scope static objects with constructor/destructors in function
4140
42-
The following code generates C2603:
41+
In versions of the Visual C++ compiler before Visual Studio 2015, or when the [/Zc:threadSafeInit-](../../build/reference/zc-threadsafeinit-thread-safe-local-static-initialization.md) compiler option is specified, there is a limit of 31 on the number of static objects you can have in an externally visible inline function.
4342

44-
```
43+
To resolve this issue, we recommend you adopt more recent version of the Visual C++ compiler toolset, or if possible, remove the /Zc:threadSafeInit- compiler option. If this is not possible, consider combining your static objects. If the objects are of the same type, consider use of a single static array of that type, and reference individual members as required.
44+
45+
## Example
46+
47+
The following code generates C2603 and shows one way to fix it:
48+
49+
```cpp
4550
// C2603.cpp
51+
// Compile by using: cl /W4 /c /Zc:threadSafeInit- C2603.cpp
4652
struct C { C() {} };
4753
extern inline void f1() {
48-
static C C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C14,C15,C16;
49-
static C C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32;
50-
static C C33; // C2603 Comment this line out to avoid error
54+
static C C01, C02, C03, C04, C05, C06, C07, C08, C09, C10;
55+
static C C11, C12, C13, C14, C15, C16, C17, C18, C19, C20;
56+
static C C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31;
57+
static C C32; // C2603 Comment this line out to avoid error
5158
}
52-
```
59+
```

0 commit comments

Comments
 (0)