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/code-quality/code-analysis-for-c-cpp-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ C:\>cl /analyze Sample.cpp
40
40
41
41
## #pragma support
42
42
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).
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.
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.
20
20
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.
22
22
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.
24
24
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.
26
26
27
-
Other limitations on **alloc_text** are as follows:
27
+
Other limitations on **`alloc_text`** are as follows:
28
28
29
29
- It can't be used inside a function.
30
30
31
31
- It must be used after the function has been declared, but before the function has been defined.
32
32
33
33
## See also
34
34
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)
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.
20
20
21
21
## See also
22
22
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)
(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*.
22
22
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.
25
25
26
26
*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.
28
28
29
29
*"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.
31
31
32
32
*"section-class"*\
33
33
(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
36
36
37
37
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.
38
38
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`.
40
40
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.
42
42
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).
44
44
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)).
46
46
47
47
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.
48
48
@@ -66,4 +66,4 @@ int main() {
66
66
67
67
## See also
68
68
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)
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.
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.
21
21
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.
0 commit comments