Skip to content

Commit 42f6694

Browse files
author
Colin Robertson
committed
Restyle C++ pragma docs for loc
1 parent 2d21c07 commit 42f6694

44 files changed

Lines changed: 637 additions & 638 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/code-quality/code-analysis-for-c-cpp-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ C:\>cl /analyze Sample.cpp
4040

4141
## #pragma support
4242

43-
You can use the `#pragma` directive to treat warnings as errors; enable or disable warnings, and suppress warnings for individual lines of code. For more information, see [Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md).
43+
You can use the `#pragma` directive to treat warnings as errors; enable or disable warnings, and suppress warnings for individual lines of code. For more information, see [Pragma directives and the `__pragma` and `_Pragma` keywords](./pragma-directives-and-the-pragma-keyword.md).
4444

4545
## Annotation support
4646

docs/preprocessor/alloc-text.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
---
2-
description: "Learn more about: alloc_text pragma"
2+
description: "Learn more about the alloc_text pragma directive in Microsoft C/C++"
33
title: "alloc_text pragma"
4-
ms.date: "08/29/2019"
4+
ms.date: 01/22/2021
55
f1_keywords: ["vc-pragma.alloc_text", "alloc_text_CPP"]
6-
helpviewer_keywords: ["alloc_text pragma", "pragmas, alloc_text"]
7-
ms.assetid: 1fd7be18-e4f7-4f70-b079-6326f72b871a
6+
helpviewer_keywords: ["alloc_text pragma", "pragma, alloc_text"]
7+
no-loc: ["pragma"]
88
---
9-
# alloc_text pragma
9+
# `alloc_text` pragma
1010

1111
Names the code section where the specified function definitions are to reside. The pragma must occur between a function declarator and the function definition for the named functions.
1212

1313
## Syntax
1414

15-
> **#pragma alloc_text(** "*textsection*" **,** *function1* [**,** *function2* ... ] **)**
15+
> **`#pragma alloc_text(`** "*textsection*" **`,`** *function1* [**`,`** *function2* ... ] **`)`**
1616
1717
## Remarks
1818

19-
The **alloc_text** pragma does not handle C++ member functions or overloaded functions. It is applicable only to functions declared with C linkage — that is, functions declared with the **extern "C"** linkage specification. If you attempt to use this pragma on a function with C++ linkage, a compiler error is generated.
19+
The **`alloc_text`** pragma does not handle C++ member functions or overloaded functions. It is applicable only to functions declared with C linkage — that is, functions declared with the **`extern "C"`** linkage specification. If you attempt to use this pragma on a function with C++ linkage, a compiler error is generated.
2020

21-
Since function addressing using **`__based`** is not supported, specifying section locations requires the use of the **alloc_text** pragma. The name specified by *textsection* should be enclosed in double quotation marks.
21+
Since function addressing using **`__based`** is not supported, specifying section locations requires the use of the **`alloc_text`** pragma. The name specified by *textsection* should be enclosed in double quotation marks.
2222

23-
The **alloc_text** pragma must appear after the declarations of any of the specified functions and before the definitions of these functions.
23+
The **`alloc_text`** pragma must appear after the declarations of any of the specified functions and before the definitions of these functions.
2424

25-
Functions referenced in an **alloc_text** pragma should be defined in the same module as the pragma. Otherwise, if an undefined function is later compiled into a different text section, the error may or may not be caught. Although the program will usually run correctly, the function will not be allocated in the intended sections.
25+
Functions referenced in an **`alloc_text`** pragma should be defined in the same module as the pragma. Otherwise, if an undefined function is later compiled into a different text section, the error may or may not be caught. Although the program will usually run correctly, the function will not be allocated in the intended sections.
2626

27-
Other limitations on **alloc_text** are as follows:
27+
Other limitations on **`alloc_text`** are as follows:
2828

2929
- It can't be used inside a function.
3030

3131
- It must be used after the function has been declared, but before the function has been defined.
3232

3333
## See also
3434

35-
[Pragma directives and the __pragma keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
35+
[Pragma directives and the `__pragma` and `_Pragma` keywords](./pragma-directives-and-the-pragma-keyword.md)

docs/preprocessor/auto-inline.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
2-
description: "Learn more about: auto_inline pragma"
2+
description: "Learn more about the auto_inline pragma directive in Microsoft C/C++"
33
title: "auto_inline pragma"
4-
ms.date: "08/29/2019"
4+
ms.date: 01/22/2021
55
f1_keywords: ["auto_inline_CPP", "vc-pragma.auto_inline"]
6-
helpviewer_keywords: ["pragmas, auto_inline", "auto_inline pragma"]
7-
ms.assetid: f7624cd1-be76-429a-881c-65c9040acf43
6+
helpviewer_keywords: ["pragma, auto_inline", "auto_inline pragma"]
7+
no-loc: ["pragma"]
88
---
9-
# auto_inline pragma
9+
# `auto_inline` pragma
1010

11-
Excludes any functions defined within the range where **off** is specified from being considered as candidates for automatic inline expansion.
11+
Excludes any functions defined within the range where **`off`** is specified from being considered as candidates for automatic inline expansion.
1212

1313
## Syntax
1414

15-
> **#pragma auto_inline(** [ { **on** | **off** } ] **)**
15+
> **`#pragma auto_inline(`** [ { **`on`** | **`off`** } ] **`)`**
1616
1717
## Remarks
1818

19-
To use the **auto_inline** pragma, place it before and immediately after, not inside, a function definition. The pragma takes effect as soon as the first function definition after the pragma is seen.
19+
To use the **`auto_inline`** pragma, place it before and immediately after, not inside, a function definition. The pragma takes effect as soon as the first function definition after the pragma is seen.
2020

2121
## See also
2222

23-
[Pragma directives and the __pragma keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
23+
[Pragma directives and the `__pragma` and `_Pragma` keywords](./pragma-directives-and-the-pragma-keyword.md)

docs/preprocessor/bss-seg.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
---
2-
description: "Learn more about: bss_seg pragma"
2+
description: "Learn more about the bss_seg pragma directive in Microsoft C/C++"
33
title: "bss_seg pragma"
4-
ms.date: "08/29/2019"
4+
ms.date: 01/22/2021
55
f1_keywords: ["vc-pragma.bss_seg", "bss_seg_CPP"]
6-
helpviewer_keywords: ["pragmas, bss_seg", "bss_seg pragma"]
7-
ms.assetid: 755f0154-de51-4778-97d3-c9b24e445079
6+
helpviewer_keywords: ["pragma, bss_seg", "bss_seg pragma"]
7+
no-loc: ["pragma"]
88
---
9-
# bss_seg pragma
9+
# `bss_seg` pragma
1010

1111
Specifies the section (segment) where uninitialized variables are stored in the object (.obj) file.
1212

1313
## Syntax
1414

15-
> **#pragma bss_seg(** [ "*section-name*" [ **,** "*section-class*" ] ] **)**\
16-
> **#pragma bss_seg(** { **push** | **pop** } [ **,** *identifier* ] [ **,** "*section-name*" [ **,** "*section-class*" ] ] **)**
15+
> **`#pragma bss_seg(`** [ "*section-name*" [ **`,`** "*section-class*" ] ] **`)`**\
16+
> **`#pragma bss_seg(`** { **`push`** | **`pop`** } [ **`,`** *identifier* ] [ **`,`** "*section-name*" [ **`,`** "*section-class*" ] ] **`)`**
1717
1818
### Parameters
1919

20-
**push**\
21-
(Optional) Puts a record on the internal compiler stack. A **push** can have an *identifier* and *section-name*.
20+
**`push`**\
21+
(Optional) Puts a record on the internal compiler stack. A **`push`** can have an *identifier* and *section-name*.
2222

23-
**pop**\
24-
(Optional) Removes a record from the top of the internal compiler stack. A **pop** can have an *identifier* and *section-name*. You can pop multiple records using just one **pop** command by using the *identifier*. The *section-name* becomes the active BSS section name after the pop.
23+
**`pop`**\
24+
(Optional) Removes a record from the top of the internal compiler stack. A **`pop`** can have an *identifier* and *section-name*. You can pop multiple records using just one **`pop`** command by using the *identifier*. The *section-name* becomes the active BSS section name after the pop.
2525

2626
*identifier*\
27-
(Optional) When used with **push**, assigns a name to the record on the internal compiler stack. When used with **pop**, the directive pops records off the internal stack until *identifier* is removed. If *identifier* isn't found on the internal stack, nothing is popped.
27+
(Optional) When used with **`push`**, assigns a name to the record on the internal compiler stack. When used with **`pop`**, the directive pops records off the internal stack until *identifier* is removed. If *identifier* isn't found on the internal stack, nothing is popped.
2828

2929
*"section-name"*\
30-
(Optional) The name of a section. When used with **pop**, the stack is popped and *section-name* becomes the active BSS section name.
30+
(Optional) The name of a section. When used with **`pop`**, the stack is popped and *section-name* becomes the active BSS section name.
3131

3232
*"section-class"*\
3333
(Optional) Ignored, but included for compatibility with versions of Microsoft C++ earlier than version 2.0.
@@ -36,13 +36,13 @@ Specifies the section (segment) where uninitialized variables are stored in the
3636

3737
A *section* in an object file is a named block of data that's loaded into memory as a unit. A *BSS section* is a section that contains uninitialized data. In this article, the terms *segment* and *section* have the same meaning.
3838

39-
The **bss_seg** pragma directive tells the compiler to put all uninitialized data items from the translation unit into a BSS section named *section-name*. In some cases, use of **bss_seg** can speed load times by grouping uninitialized data into one section. By default, the BSS section used for uninitialized data in an object file is named `.bss`. A **bss_seg** pragma directive without a *section-name* parameter resets the BSS section name for the subsequent uninitialized data items to `.bss`.
39+
The **`bss_seg`** pragma directive tells the compiler to put all uninitialized data items from the translation unit into a BSS section named *section-name*. In some cases, use of **`bss_seg`** can speed load times by grouping uninitialized data into one section. By default, the BSS section used for uninitialized data in an object file is named `.bss`. A **`bss_seg`** pragma directive without a *section-name* parameter resets the BSS section name for the subsequent uninitialized data items to `.bss`.
4040

41-
Data allocated using the **bss_seg** pragma does not retain any information about its location.
41+
Data allocated using the **`bss_seg`** pragma does not retain any information about its location.
4242

43-
For a list of names that shouldn't be used to create a section, see [/SECTION](../build/reference/section-specify-section-attributes.md).
43+
For a list of names that shouldn't be used to create a section, see [`/SECTION`](../build/reference/section-specify-section-attributes.md).
4444

45-
You can also specify sections for initialized data ([data_seg](../preprocessor/data-seg.md)), functions ([code_seg](../preprocessor/code-seg.md)), and const variables ([const_seg](../preprocessor/const-seg.md)).
45+
You can also specify sections for initialized data ([`data_seg`](../preprocessor/data-seg.md)), functions ([`code_seg`](../preprocessor/code-seg.md)), and const variables ([`const_seg`](../preprocessor/const-seg.md)).
4646

4747
You can use the [DUMPBIN.EXE](../build/reference/dumpbin-command-line.md) application to view object files. Versions of DUMPBIN for each supported target architecture are included with Visual Studio.
4848

@@ -66,4 +66,4 @@ int main() {
6666

6767
## See also
6868

69-
[Pragma directives and the __pragma keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
69+
[Pragma directives and the `__pragma` and `_Pragma` keywords](./pragma-directives-and-the-pragma-keyword.md)

docs/preprocessor/check-stack.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
---
2-
description: "Learn more about: check_stack pragma"
2+
description: "Learn more about the check_stack pragma directive in Microsoft C/C++"
33
title: "check_stack pragma"
4-
ms.date: "08/29/2019"
4+
ms.date: 01/22/2021
55
f1_keywords: ["vc-pragma.check_stack", "check_stack_CPP"]
6-
helpviewer_keywords: ["check_stack pragma", "pragmas, check_stack", "pragmas, check_stack usage table"]
7-
ms.assetid: f18e20cc-9abb-48b7-ad62-8d384875b996
6+
helpviewer_keywords: ["check_stack pragma", "pragma, check_stack", "pragma, check_stack usage table"]
7+
no-loc: ["pragma"]
88
---
9-
# check_stack pragma
9+
# `check_stack` pragma
1010

11-
Instructs the compiler to turn off stack probes if **off** (or **-**) is specified, or to turn on stack probes if **on** (or **+**) is specified.
11+
Instructs the compiler to turn off stack probes if **`off`** (or **`-`**) is specified, or to turn on stack probes if **`on`** (or **`+`**) is specified.
1212

1313
## Syntax
1414

15-
> **#pragma check_stack(** [{ **on** | **off** }] **)**\
16-
> **#pragma check_stack** { **+** | **-** }
15+
> **`#pragma check_stack(`** [{ **`on`** | **`off`** }] **`)`**\
16+
> **`#pragma check_stack`** { **`+`** | **`-`** }
1717
1818
## Remarks
1919

2020
This pragma takes effect at the first function defined after the pragma is seen. Stack probes are neither a part of macros nor of functions that are generated inline.
2121

22-
If you don't give an argument for the **check_stack** pragma, stack checking reverts to the behavior specified on the command line. For more information, see [Compiler options](../build/reference/compiler-options.md). The interaction of the `#pragma check_stack` and the [/Gs](../build/reference/gs-control-stack-checking-calls.md) option is summarized in the following table.
22+
If you don't give an argument for the **`check_stack`** pragma, stack checking reverts to the behavior specified on the command line. For more information, see [Compiler options](../build/reference/compiler-options.md). The interaction of the `#pragma check_stack` and the [`/Gs`](../build/reference/gs-control-stack-checking-calls.md) option is summarized in the following table.
2323

2424
### Using the check_stack Pragma
2525

26-
|Syntax|Compiled with<br /><br /> /Gs option?|Action|
27-
|------------|------------------------------------|------------|
28-
|`#pragma check_stack( )` or<br /><br /> `#pragma check_stack`|Yes|Turns off stack checking for functions that follow|
29-
|`#pragma check_stack( )` or<br /><br /> `#pragma check_stack`|No|Turns on stack checking for functions that follow|
30-
|`#pragma check_stack(on)`<br /><br /> or `#pragma check_stack +`|Yes or No|Turns on stack checking for functions that follow|
31-
|`#pragma check_stack(off)`<br /><br /> or `#pragma check_stack -`|Yes or No|Turns off stack checking for functions that follow|
26+
| Syntax | Compiled with<br /><br /> `/Gs` option? | Action |
27+
|--|--|--|
28+
| `#pragma check_stack( )` or<br /><br /> `#pragma check_stack` | Yes | Turns off stack checking for functions that follow |
29+
| `#pragma check_stack( )` or<br /><br /> `#pragma check_stack` | No | Turns on stack checking for functions that follow |
30+
| `#pragma check_stack(on)`<br /><br /> or `#pragma check_stack +` | Yes or No | Turns on stack checking for functions that follow |
31+
| `#pragma check_stack(off)`<br /><br /> or `#pragma check_stack -` | Yes or No | Turns off stack checking for functions that follow |
3232

3333
## See also
3434

35-
[Pragma directives and the __pragma keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
35+
[Pragma directives and the `__pragma` and `_Pragma` keywords](./pragma-directives-and-the-pragma-keyword.md)

0 commit comments

Comments
 (0)