Skip to content

Commit 8c2de32

Browse files
authored
Merge pull request #1534 from MicrosoftDocs/master
10/26 AM Publish
2 parents 072e12d + fe82fe4 commit 8c2de32

File tree

8 files changed

+175
-173
lines changed

8 files changed

+175
-173
lines changed

docs/build/reference/gs-control-stack-checking-calls.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "-Gs (Control Stack Checking Calls) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "10/25/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
f1_keywords: ["/GS"]
@@ -14,43 +14,45 @@ ms.workload: ["cplusplus"]
1414
---
1515
# /Gs (Control Stack Checking Calls)
1616

17-
Controls stack probes.
17+
Controls the threshold for stack probes.
1818

1919
## Syntax
2020

21-
```
22-
/Gs[size]
23-
```
21+
> **/Gs**[*size*]
2422
2523
## Arguments
2624

2725
*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*.
2927

3028
## Remarks
3129

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.
3331

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.
3533

3634
> [!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.
3836
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.
4038

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.
4240

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.
4448

4549
### To set this compiler option in the Visual Studio development environment
4650

4751
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
4852

49-
1. Select the **C/C++** folder.
50-
51-
1. Select the **Command Line** property page.
53+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
5254

53-
1. Type the compiler option in the **Additional Options** box.
55+
1. Enter the **/Gs** compiler option and an optional size in **Additional Options**. Choose **OK** or **Apply** to save your changes.
5456

5557
### To set this compiler option programmatically
5658

docs/ide/cmake-tools-for-visual-cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "CMake Projects in Visual C++ | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "09/26/2018"
4+
ms.date: "10/18/2018"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: ["cpp-ide"]
@@ -79,7 +79,7 @@ Not everything in the cache is imported. Properties such as the generator and t
7979
To build a CMake project, you have these choices:
8080

8181
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.
8383
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.
8484

8585
![CMake build menu command](media/cmake-build-menu.png "CMake build command menu")
@@ -205,7 +205,7 @@ To specify a Visual Studio generator, open the CMakeSettings.json from the main
205205

206206
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.
207207

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:
209209

210210
```json
211211
"variables": [
@@ -275,7 +275,7 @@ CMakeSettings.json now supports inherited environments. This feature enables you
275275

276276
The example above is the same as running the **Developer Command Prompt for VS 2017** with the **-arch=amd64 -host_arch=amd64** arguments.
277277

278-
The following table shows the default values and their command line equivalents:
278+
The following table shows the default values:
279279

280280
|Context Name|Description|
281281
|-----------|-----------------|

docs/linux/TOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [Download, Install and Setup the Linux Development Workload](download-install-and-setup-the-linux-development-workload.md)
2-
# [Create a New Linux Project](create-a-new-linux-project.md)
32
# [Configure a Linux Project](configure-a-linux-project.md)
43
# [Configure a Linux CMake Project](cmake-linux-project.md)
4+
# [Create a New Linux Project](create-a-new-linux-project.md)
55
# [Connect to Your Remote Linux Computer](connect-to-your-remote-linux-computer.md)
66
# [Deploy, Run, and Debug Your Linux Project](deploy-run-and-debug-your-linux-project.md)
77
# [Linux Project Property Page Reference](prop-pages-linux.md)

docs/linux/create-a-new-linux-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus", "linux"]
1515

1616
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).
1717

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).
1919

2020
To create a new Linux project in Visual Studio, do the following:
2121

docs/linux/download-install-and-setup-the-linux-development-workload.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ You can use the Visual Studio IDE in Windows to create, edit and debug C++ proje
1818

1919
## Visual Studio setup
2020

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:
22+
![Windows search box](media/visual-studio-installer-search.png)
23+
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.
2224

2325
![Visual C++ for Linux Development workload](media/linuxworkload.png)
2426

9.3 KB
Loading

0 commit comments

Comments
 (0)