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/preprocessor/alloc-text.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,21 +8,21 @@ no-loc: ["pragma"]
8
8
---
9
9
# `alloc_text` pragma
10
10
11
-
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.
11
+
Names the code section where the specified function definitions are placed. 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 doesn't handle C++ member functions or overloaded functions. It's 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`**isn't supported, specifying section locations requires the use of the **`alloc_text`** pragma. The name specified by *text-section* should be enclosed in double quotation marks.
22
22
23
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 won't be allocated in the intended sections.
26
26
27
27
Other limitations on **`alloc_text`** are as follows:
Copy file name to clipboardExpand all lines: docs/preprocessor/comment-c-cpp.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,17 @@ Places a comment record into an object file or executable file.
16
16
17
17
## Remarks
18
18
19
-
The *comment-type* is one of the predefined identifiers, described below, that specifies the type of comment record. The optional *comment-string* is a string literal that provides additional information for some comment types. Because *comment-string* is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks (`"`), and concatenation.
19
+
The *comment-type* is one of the predefined identifiers, described below, that specifies the type of comment record. The optional *comment-string* is a string literal that provides additional information for some comment types. Because *comment-string* is a string literal, it obeys all the rules for string literals on use of escape characters, embedded quotation marks (`"`), and concatenation.
20
20
21
21
### compiler
22
22
23
23
Places the name and version number of the compiler in the object file. This comment record is ignored by the linker. If you supply a *comment-string* parameter for this record type, the compiler generates a warning.
24
24
25
25
### lib
26
26
27
-
Places a library-search record in the object file. This comment type must be accompanied by a *comment-string* parameter containing the name (and possibly the path) of the library that you want the linker to search. The library name follows the default library-search records in the object file; the linker searches for this library just as if you had named it on the command line provided that the library is not specified with [`/nodefaultlib`](../build/reference/nodefaultlib-ignore-libraries.md). You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.
27
+
Places a library-search record in the object file. This comment type must be accompanied by a *comment-string* parameter that has the name (and possibly the path) of the library that you want the linker to search. The library name follows the default library-search records in the object file. The linker searches for this library the same way as if you specified it on the command line, as long as the library isn't specified by using [`/nodefaultlib`](../build/reference/nodefaultlib-ignore-libraries.md). You can place multiple library-search records in the same source file. Each record appears in the object file in the same order it's found in the source file.
28
28
29
-
If the order of the default library and an added library is important, compiling with the [`/Zl`](../build/reference/zl-omit-default-library-name.md) switch will prevent the default library name from being placed in the object module. A second comment pragma then can be used to insert the name of the default library after the added library. The libraries listed with these pragma directives will appear in the object module in the same order they are found in the source code.
29
+
If the order of the default library and an added library is important, compiling with the [`/Zl`](../build/reference/zl-omit-default-library-name.md) switch will prevent the default library name from being placed in the object module. A second comment pragma then can be used to insert the name of the default library after the added library. The libraries listed with these pragma directives will appear in the object module in the same order they're found in the source code.
30
30
31
31
### linker
32
32
@@ -56,7 +56,7 @@ Places a general comment in the object file. The *comment-string* parameter cont
56
56
57
57
## Examples
58
58
59
-
The following pragma causes the linker to search for the EMAPI.LIB library while linking. The linker searches first in the current working directory and then in the path specified in the LIB environment variable.
59
+
The following pragma causes the linker to search for the EMAPI.LIB library while linking. The linker searches first in the current working directory, and then in the path specified in the LIB environment variable.
60
60
61
61
```C
62
62
#pragma comment( lib, "emapi" )
@@ -68,7 +68,7 @@ The following pragma causes the compiler to place the name and version number of
68
68
#pragma comment( compiler )
69
69
```
70
70
71
-
For comments that take a *comment-string* parameter, you can use a macro in any place where you would use a string literal, provided that the macro expands to a string literal. You can also concatenate any combination of string literals and macros that expand to string literals. For example, the following statement is acceptable:
71
+
For comments that take a *comment-string* parameter, you can use a macro in any place where you would use a string literal, as long as the macro expands to a string literal. You can also concatenate any combination of string literals and macros that expand to string literals. For example, the following statement is acceptable:
72
72
73
73
```C
74
74
#pragma comment( user, "Compiled on " __DATE__ " at " __TIME__ )
Copy file name to clipboardExpand all lines: docs/preprocessor/execution-character-set.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ no-loc: ["pragma"]
8
8
---
9
9
# `execution_character_set` pragma
10
10
11
-
Specifies the execution character set used for string and character literals. This directive is not needed for literals marked with the `u8` prefix.
11
+
Specifies the execution character set used for string and character literals. This directive isn't needed for literals marked with the `u8` prefix.
12
12
13
13
## Syntax
14
14
@@ -25,9 +25,9 @@ This compiler directive is obsolete starting in Visual Studio 2015 Update 2. We
25
25
26
26
The `#pragma execution_character_set("utf-8")` directive tells the compiler to encode narrow character and narrow string literals in your source code as UTF-8 in the executable. This output encoding is independent of the source file encoding used.
27
27
28
-
By default, the compiler encodes narrow characters and narrow strings by using the current code page as the execution character set. This means that Unicode or DBCS characters in a literal that are outside the range of the current code page are converted to the default replacement character in the output. Unicode and DBCS characters are truncated to their low-order byte. This is almost certainly not what you intend. You can specify UTF-8 encoding for literals in the source file by using a `u8` prefix. The compiler passes these UTF-8 encoded strings to the output unchanged. Narrow character literals prefixed by using u8 must fit in one byte, or they are truncated on output.
28
+
By default, the compiler encodes narrow characters and narrow strings by using the current code page as the execution character set. It means that Unicode or DBCS characters outside the range of the current code page get converted to the default replacement character in the output. Unicode and DBCS characters are truncated to their low-order byte, which is almost never what you intend. You can specify UTF-8 encoding for literals in the source file by using a `u8` prefix. The compiler passes these UTF-8 encoded strings to the output unchanged. Narrow character literals prefixed by using u8 must fit in a byte, or they're truncated on output.
29
29
30
-
By default, Visual Studio uses the current code page as the source character set used to interpret your source code for output. When a file is read in, Visual Studio interprets it according to the current code page unless the file code page was set, or unless a byte-order mark (BOM) or UTF-16 characters are detected at the beginning of the file. Because UTF-8 can't be set as the current code page, when the automatic detection encounters source files encoded as UTF-8 without a BOM, Visual Studio assumes that they are encoded by using the current code page. Characters in the source file that are outside the range of the specified or automatically detected code page can cause compiler warnings and errors.
30
+
By default, Visual Studio uses the current code page as the source character set used to interpret your source code for output. When a file is read in, Visual Studio interprets it according to the current code page unless the file code page was set, or unless a byte-order mark (BOM) or UTF-16 characters are detected at the beginning of the file. You can't set UTF-8 as the current code page in some versions of Windows. When the automatic detection finds source files encoded as UTF-8 without a BOM in those versions, Visual Studio assumes they're encoded by using the current code page. Characters in the source file that are outside the range of the specified or automatically detected code page can cause compiler warnings and errors.
0 commit comments