You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/reference/gs-control-stack-checking-calls.md
+18-16Lines changed: 18 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "-Gs (Control Stack Checking Calls) | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/04/2016"
4
+
ms.date: "10/25/2018"
5
5
ms.technology: ["cpp-tools"]
6
6
ms.topic: "reference"
7
7
f1_keywords: ["/GS"]
@@ -14,43 +14,45 @@ ms.workload: ["cplusplus"]
14
14
---
15
15
# /Gs (Control Stack Checking Calls)
16
16
17
-
Controls stack probes.
17
+
Controls the threshold for stack probes.
18
18
19
19
## Syntax
20
20
21
-
```
22
-
/Gs[size]
23
-
```
21
+
> **/Gs**[*size*]
24
22
25
23
## Arguments
26
24
27
25
*size*<br/>
28
-
(Optional) The number of bytes that local variables can occupy before a stack probe is initiated. If the **/Gs**option is specified without a `size` argument, it is the same as specifying **/Gs0**,
26
+
(Optional) The number of bytes that local variables can occupy before a stack probe is initiated. No space is allowed between **/Gs**and *size*.
29
27
30
28
## Remarks
31
29
32
-
A stack probe is a sequence of code that the compiler inserts into every function call. When initiated, a stack probe reaches benignly into memory by the amount of space that is required to store the function's local variables.
30
+
A *stack probe* is a sequence of code that the compiler inserts at the beginning of a function call. When initiated, a stack probe reaches benignly into memory by the amount of space that is required to store the function's local variables. This causes the operating system to transparently page in additional stack memory if required, before the rest of the function runs.
33
31
34
-
If a function requires more than `size` bytes of stack space for local variables, its stack probe is initiated. By default, the compiler generates code that initiates a stack probe when a function requires more than one page of stack space. This is equivalent to a compiler option of **/Gs4096** for x86, x64, and ARM platforms. This value allows an application and the Windows memory manager to increase the amount of memory committed to the program stack dynamically at run time.
32
+
By default, the compiler generates code that initiates a stack probe when a function requires more than one page of stack space. This is equivalent to a compiler option of **/Gs4096** for x86, x64, ARM, and ARM64 platforms. This value allows an application and the Windows memory manager to increase the amount of memory committed to the program stack dynamically at run time.
35
33
36
34
> [!NOTE]
37
-
> The default value of **/Gs4096** allows the program stack of applications for Windows to grow correctly at run time. We recommend that you do not change the default value unless you know exactly why you have to change it.
35
+
> The default value of **/Gs4096** allows the program stack of applications for Windows to grow correctly at run time. We recommend that you do not change the default value unless you know exactly why you have to change it.
38
36
39
-
Some programs—for example, virtual device drivers—do not require this default stack-growth mechanism. In such cases, the stack probes are not necessary and you can stop the compiler from generating them by setting `size` to a value that is larger than any function will require for local variable storage. No space is allowed between **/Gs** and `size`.
37
+
Some programs—for example, virtual device drivers—do not require this default stack-growth mechanism. In such cases, the stack probes are not necessary and you can stop the compiler from generating them by setting *size* to a value that is larger than any function will require for local variable storage.
40
38
41
-
**/Gs0**activates stack probes for every function call that requires storage for local variables. This can have a negative impact on performance.
39
+
**/Gs0**initiates stack probes for every function call that requires storage for local variables. This can have a negative impact on performance.
42
40
43
-
You can turn stack probes on or off by using [check_stack](../../preprocessor/check-stack.md). **/Gs** and the `check_stack` pragma have no effect on standard C library routines; they affect only the functions you compile.
41
+
For x64 targets, if the **/Gs** option is specified without a *size* argument, it is the same as **/Gs0**. If the *size* argument is 1 through 9, warning D9014 is emitted, and the effect is the same as specifying **/Gs0**.
42
+
43
+
For x86, ARM, and ARM64 targets, the **/Gs** option without a *size* argument is the same as **/Gs4096**. If the *size* argument is 1 through 9, warning D9014 is emitted, and the effect is the same as specifying **/Gs4096**.
44
+
45
+
For all targets, a *size* argument between 10 and 2147485647 sets the threshold at the specified value. A *size* of 2147485648 or greater causes fatal error C1049.
46
+
47
+
You can turn stack probes on or off by using the [check_stack](../../preprocessor/check-stack.md) directive. **/Gs** and the `check_stack` pragma have no effect on standard C library routines; they affect only the functions you compile.
44
48
45
49
### To set this compiler option in the Visual Studio development environment
46
50
47
51
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
Copy file name to clipboardExpand all lines: docs/ide/cmake-tools-for-visual-cpp.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "CMake Projects in Visual C++ | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "09/26/2018"
4
+
ms.date: "10/18/2018"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology: ["cpp-ide"]
@@ -79,7 +79,7 @@ Not everything in the cache is imported. Properties such as the generator and t
79
79
To build a CMake project, you have these choices:
80
80
81
81
1. Select the target in the **Debug** dropdown and press **F5**, or click the **Run** (green triangle) button. The project automatically builds first, just like a Visual Studio solution.
82
-
1. Right click on the CMakeLists.txt and select **Build** from the context menu. If you have multiple targets in your folder structure, you can choose to build all or only one specific target, or
82
+
1. Right click on the CMakeLists.txt and select **Build** from the context menu. If you have multiple targets in your folder structure, you can choose to build all or only one specific target.
83
83
1. From the main menu, select **Build | Build Solution** (**F7** or **Ctrl+Shift+B**). Make sure that a CMake target is already selected in the **Startup Item** dropdown in the **General** toolbar.
84
84
85
85

@@ -205,7 +205,7 @@ To specify a Visual Studio generator, open the CMakeSettings.json from the main
205
205
206
206
1.**buildRoot**: maps to **-DCMAKE_BINARY_DIR** switch and specifies where the CMake cache will be created. If the folder does not exist, it is created.
207
207
208
-
1.**variables**: contains a name-value pair of CMake variables that will get passed as **-D**_name_**=**_value_ to CMake. If your CMake project build instructions specify the addition of any variables directly to the CMake cache file, it is recommended that you add them here instead. The following example shows how to specify the name-value pairs:
208
+
1.**variables**: contains a name-value pair of CMake variables that will get passed as **-D***_name_=_value_* to CMake. If your CMake project build instructions specify the addition of any variables directly to the CMake cache file, it is recommended that you add them here instead. The following example shows how to specify the name-value pairs:
209
209
210
210
```json
211
211
"variables": [
@@ -275,7 +275,7 @@ CMakeSettings.json now supports inherited environments. This feature enables you
275
275
276
276
The example above is the same as running the **Developer Command Prompt for VS 2017** with the **-arch=amd64 -host_arch=amd64** arguments.
277
277
278
-
The following table shows the default values and their command line equivalents:
First, make sure you have the **Linux Development Workload** for Visual Studio installed. For more information, see [Download, install, and setup the Linux workload](download-install-and-setup-the-linux-development-workload.md).
17
17
18
-
When coding C++ in Visual Studio for Linux, you have the choice of creating a Visual Studio project, or a CMake project. This topic describes how to create a Visual Studio project. For information about CMake Projects, see [Configure a Linux CMake Project ](cmake-linux-project.md).
18
+
When creating a new C++ project in Visual Studio for Linux, you have the choice of creating a Visual Studio project, or a CMake project. This topic describes how to create a Visual Studio project. For information about creating and working with existing CMake Projects, see [Configure a Linux CMake Project ](cmake-linux-project.md).
19
19
20
20
To create a new Linux project in Visual Studio, do the following:
Copy file name to clipboardExpand all lines: docs/linux/download-install-and-setup-the-linux-development-workload.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,9 @@ You can use the Visual Studio IDE in Windows to create, edit and debug C++ proje
18
18
19
19
## Visual Studio setup
20
20
21
-
1. Type "Visual Studio Installer" in the Windows search menu; look for it under the **Apps** results and double-click it. When the installer opens, choose **Modify**, and then click on the **Workloads** tab. Scroll down to **Other toolsets** and select the **Linux development with C++** workload.
21
+
1. Type "Visual Studio Installer" in the Windows search box:
2. Look for the installer under the **Apps** results and double-click it. When the installer opens, choose **Modify**, and then click on the **Workloads** tab. Scroll down to **Other toolsets** and select the **Linux development with C++** workload.
22
24
23
25

0 commit comments