Skip to content

Commit ba669ed

Browse files
author
3836425+corob-msft@users.noreply.github.com
committed
Fix cpp-docs 3815 3898 3901 3902
1 parent 56ab2e8 commit ba669ed

7 files changed

Lines changed: 53 additions & 23 deletions

File tree

docs/build/x64-calling-convention.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "x64 calling convention"
33
description: "Learn about the details of the default x64 calling convention."
4-
ms.date: 04/21/2022
4+
ms.date: 05/17/2022
55
---
66
# x64 calling convention
77

@@ -15,7 +15,7 @@ There's a strict one-to-one correspondence between a function call's arguments a
1515

1616
The x87 register stack is unused. It may be used by the callee, but consider it volatile across function calls. All floating point operations are done using the 16 XMM registers.
1717

18-
Integer arguments are passed in registers RCX, RDX, R8, and R9. Floating point arguments are passed in XMM0L, XMM1L, XMM2L, and XMM3L. 16-byte arguments are passed by reference. Parameter passing is described in detail in [Parameter passing](#parameter-passing). These registers, and RAX, R10, R11, XMM4, and XMM5, are considered volatile. Register usage is documented in detail in [x64 register usage](x64-software-conventions.md#x64-register-usage) and [Caller/callee saved registers](#callercallee-saved-registers).
18+
Integer arguments are passed in registers RCX, RDX, R8, and R9. Floating point arguments are passed in XMM0L, XMM1L, XMM2L, and XMM3L. 16-byte arguments are passed by reference. Parameter passing is described in detail in [Parameter passing](#parameter-passing). These registers, and RAX, R10, R11, XMM4, and XMM5, are considered *volatile*, or potentially changed by a callee on return. Register usage is documented in detail in [x64 register usage](x64-software-conventions.md#x64-register-usage) and [Caller/callee saved registers](#callercallee-saved-registers).
1919

2020
For prototyped functions, all arguments are converted to the expected callee types before passing. The caller is responsible for allocating space for the callee's parameters. The caller must always allocate sufficient space to store four register parameters, even if the callee doesn't take that many parameters. This convention simplifies support for unprototyped C-language functions and vararg C/C++ functions. For vararg or unprototyped functions, any floating point values must be duplicated in the corresponding general-purpose register. Any parameters beyond the first four must be stored on the stack after the shadow store before the call. Vararg function details can be found in [Varargs](#varargs). Unprototyped function information is detailed in [Unprototyped functions](#unprototyped-functions).
2121

@@ -146,7 +146,7 @@ Struct2 func4(int a, double b, int c, float d);
146146

147147
## Caller/callee saved registers
148148

149-
The x64 ABI considers the registers RAX, RCX, RDX, R8, R9, R10, R11, and XMM0-XMM5 volatile. When present, the upper portions of YMM0-YMM15 and ZMM0-ZMM15 are also volatile. On AVX512VL, the ZMM, YMM, and XMM registers 16-31 are also volatile. Consider volatile registers destroyed on function calls unless otherwise safety-provable by analysis such as whole program optimization.
149+
The x64 ABI considers the registers RAX, RCX, RDX, R8, R9, R10, R11, and XMM0-XMM5 volatile. When present, the upper portions of YMM0-YMM15 and ZMM0-ZMM15 are also volatile. On AVX512VL, the ZMM, YMM, and XMM registers 16-31 are also volatile. When AMX support is present, the TMM tile registers are volatile. Consider volatile registers destroyed on function calls unless otherwise safety-provable by analysis such as whole program optimization.
150150

151151
The x64 ABI considers registers RBX, RBP, RDI, RSI, RSP, R12, R13, R14, R15, and XMM6-XMM15 nonvolatile. They must be saved and restored by a function that uses them.
152152

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
---
22
description: "Learn more about: Inline Functions"
33
title: "Inline Functions"
4-
ms.date: "10/16/2017"
4+
ms.date: 05/17/2022
55
helpviewer_keywords: ["fast code", "inline functions, __inline keyword", "functions [C++], inline functions"]
66
ms.assetid: 00f4b2ff-8ad0-4165-9f4c-2ef157d03f31
77
---
8-
# Inline Functions
8+
# Inline functions
99

10-
**Microsoft Specific**
10+
**Microsoft specific**
1111

12-
The **`__inline`** keyword tells the compiler to substitute the code within the function definition for every instance of a function call. However, substitution occurs only at the compiler's discretion. For example, the compiler does not inline a function if its address is taken or if it is too large to inline.
12+
The **`__inline`** keyword tells the compiler to substitute the code within the function definition for every instance of a function call.
1313

14-
For a function to be considered as a candidate for inlining, it must use the new-style function definition.
14+
## Remarks
15+
16+
Inline code substitution occurs only at the compiler's discretion. For example, the compiler won't inline a function if its address is taken or if it's too large to inline. When the compiler doesn't inline a function defined in a header file, it's marked for the linker to avoid one-definition rule (ODR) violations.
17+
18+
For a function to be considered as a candidate for inlining, it must use the new-style function definition with a signature that declares the return type and any parameter types.
1519

1620
Use this form to specify an inline function:
1721

18-
> **`__inline`** *type*<sub>opt</sub> *function-definition*
22+
> **`__inline`** *function-definition*
1923
20-
The use of inline functions generates faster code and can sometimes generate smaller code than the equivalent function call generates for the following reasons:
24+
Inline functions generate faster and sometimes smaller code than the equivalent function call:
2125

22-
- It saves the time required to execute function calls.
26+
- Inline functions save the time required to prepare the stack for arguments and a return value, and the time to execute the jump and return of a function call.
2327

24-
- Small inline functions, perhaps three lines or less, create less code than the equivalent function call because the compiler doesn't generate code to handle arguments and a return value.
28+
- Even when repeated several times, small inline functions of perhaps three lines or less create less code than the equivalent function call because the compiler doesn't generate code to handle arguments and a return value.
2529

26-
- Functions generated inline are subject to code optimizations not available to normal functions because the compiler does not perform interprocedural optimizations.
30+
- The compiler can optimize functions generated inline in ways that aren't available to normal functions. The compiler doesn't usually perform optimizations between different procedures.
2731

28-
Functions using **`__inline`** should not be confused with inline assembler code. See [Inline Assembler](../c-language/inline-assembler-c.md) for more information.
32+
Don't confuse functions that use **`__inline`** with inline assembler code. For more information about inline assembler, see [Inline assembler](../c-language/inline-assembler-c.md).
2933

30-
**END Microsoft Specific**
34+
**END Microsoft specific**
3135

3236
## See also
3337

34-
[inline, __inline, \__forceinline](../cpp/inline-functions-cpp.md)
38+
[`inline`, `__inline`, `__forceinline`](../cpp/inline-functions-cpp.md)

docs/cpp/inline-functions-cpp.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
---
22
title: "Inline Functions (C++)"
33
description: "The C++ inline keyword can be used to suggest inline functions to the compiler."
4-
ms.date: "10/09/2018"
4+
ms.date: 05/17/2022
55
f1_keywords: ["__forceinline_cpp", "__inline_cpp", "inline_cpp", "__inline", "_inline", "__forceinline", "_forceinline"]
66
helpviewer_keywords: ["inline functions [C++], class members"]
77
ms.assetid: 355f120c-2847-4608-ac04-8dda18ffe10c
88
---
9-
# Inline Functions (C++)
9+
# Inline functions (C++)
1010

11-
A function defined in the body of a class declaration is an inline function.
11+
The **`inline`** keyword tells the compiler to substitute the code within the function definition for every instance of a function call.
12+
13+
Using inline functions can make your program faster because they eliminate the overhead associated with function calls. The compiler can optimize functions expanded inline in ways that aren't available to normal functions.
14+
15+
Inline code substitution occurs at the compiler's discretion. For example, the compiler won't inline a function if its address is taken or if it's too large to inline.
16+
17+
A function defined in the body of a class declaration is implicitly an inline function.
1218

1319
## Example
1420

@@ -61,8 +67,6 @@ The insertion, called *inline expansion* or *inlining*, occurs only if the compi
6167
6268
The **`__forceinline`** keyword overrides the cost-benefit analysis and relies on the judgment of the programmer instead. Exercise caution when using **`__forceinline`**. Indiscriminate use of **`__forceinline`** can result in larger code with only marginal performance gains or, in some cases, even performance losses (because of the increased paging of a larger executable, for example).
6369
64-
Using inline functions can make your program faster because they eliminate the overhead associated with function calls. Functions expanded inline are subject to code optimizations not available to normal functions.
65-
6670
The compiler treats the inline expansion options and keywords as suggestions. There's no guarantee that functions will be inlined. You can't force the compiler to inline a particular function, even with the **`__forceinline`** keyword. When compiling with **`/clr`**, the compiler won't inline a function if there are security attributes applied to the function.
6771
6872
The **`inline`** keyword is available only in C++. The **`__inline`** and **`__forceinline`** keywords are available in both C and C++. For compatibility with previous versions, **`_inline`** and **`_forceinline`** are synonyms for **`__inline`**, and **`__forceinline`** unless compiler option [`/Za` \(Disable language extensions)](../build/reference/za-ze-disable-language-extensions.md) is specified.
@@ -75,6 +79,8 @@ The **`inline`** keyword tells the compiler that inline expansion is preferred.
7579
7680
These reasons may interfere with inlining, *as may others*, at the discretion of the compiler; you shouldn't depend on the **`inline`** specifier to cause a function to be inlined.
7781
82+
Rather than expand an inline function defined in a header file, the compiler may create it as a callable function in more than one translation unit. The compiler marks the generated function for the linker to prevent one-definition-rule (ODR) violations.
83+
7884
As with normal functions, there's no defined order for argument evaluation in an inline function. In fact, it could be different from the argument evaluation order when passed using the normal function-call protocol.
7985
8086
The [`/Ob`](../build/reference/ob-inline-function-expansion.md) compiler optimization option helps to determine whether inline function expansion actually occurs.
@@ -254,5 +260,5 @@ Sample Output: A
254260

255261
## See also
256262

257-
[`noinline`](../cpp/noinline.md)<br/>
263+
[`noinline`](../cpp/noinline.md)\
258264
[`auto_inline`](../preprocessor/auto-inline.md)

docs/error-messages/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,6 +4559,8 @@ items:
45594559
href: tool-errors/linker-tools-error-lnk1168.md
45604560
- name: Linker tools error LNK1169
45614561
href: tool-errors/linker-tools-error-lnk1169.md
4562+
- name: Linker tools error LNK1170
4563+
href: tool-errors/linker-tools-error-lnk1170.md
45624564
- name: Linker tools error LNK1179
45634565
href: tool-errors/linker-tools-error-lnk1179.md
45644566
- name: Linker tools error LNK1181
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
description: "Learn more about: Linker tools Error LNK1170"
3+
title: "Linker tools Error LNK1170"
4+
ms.date: 05/17/2022
5+
f1_keywords: ["LNK1170"]
6+
helpviewer_keywords: ["LNK1170"]
7+
ms.assetid: e079d518-f184-48cd-8b38-969bf137af54
8+
---
9+
# Linker tools Error LNK1170
10+
11+
> line in command file contains *maximum-length* or more characters
12+
13+
The build failed because a line in a command response file was too long. A line in an automatically generated response file may be too long for many reasons. For example, this error may occur if the number of object file names is too high. Or, if the combined lengths of the paths included in object file names is too long.
14+
15+
The appropriate fix for this issue depends on the cause. For example, if it's caused by long paths in object file names, you may try to shorten the directory names in the path. Or, move the project tree into a directory closer to the root of the drive. You may want to break up how response files are generated and consumed by your build system, for instance, by generating some code as static libraries.

docs/error-messages/tool-errors/linker-tools-errors-and-warnings.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: "Learn more about: Linker tools errors and warnings (LNKxxxx)"
33
title: "Linker tools errors and warnings"
44
ms.date: "09/10/2019"
5-
f1_keywords: ["LNK1100", "LNK1101", "LNK1102", "LNK1105", "LNK1108", "LNK1109", "LNK1111", "LNK1114", "LNK1115", "LNK1117", "LNK1118", "LNK1119", "LNK1121", "LNK1129", "LNK1130", "LNK1131", "LNK1132", "LNK1137", "LNK1144", "LNK1145", "LNK1146", "LNK1147", "LNK1148", "LNK1149", "LNK1154", "LNK1155", "LNK1156", "LNK1159", "LNK1160", "LNK1161", "LNK1162", "LNK1163", "LNK1165", "LNK1167", "LNK1170", "LNK1171", "LNK1172", "LNK1173", "LNK1174", "LNK1175", "LNK1178", "LNK1180", "LNK1182", "LNK1183", "LNK1184", "LNK1185", "LNK1186", "LNK1187", "LNK1190", "LNK1194", "LNK1195", "LNK1197", "LNK1198", "LNK1199", "LNK1207", "LNK1209", "LNK1210", "LNK1212", "LNK1213", "LNK1214", "LNK1216", "LNK1219", "LNK1220", "LNK1227", "LNK1229", "LNK1230", "LNK1232", "LNK1233", "LNK1234", "LNK1235", "LNK1236", "LNK1242", "LNK1243", "LNK1244", "LNK1246", "LNK1247", "LNK1249", "LNK1250", "LNK1252", "LNK1253", "LNK1255", "LNK1257", "LNK1258", "LNK1260", "LNK1261", "LNK1262", "LNK1263", "LNK1265", "LNK1266", "LNK1267", "LNK1268", "LNK1269", "LNK1270", "LNK1272", "LNK1274", "LNK1276", "LNK1279", "LNK1280", "LNK1281", "LNK1283", "LNK1285", "LNK1286", "LNK1289", "LNK1290", "LNK1291", "LNK1292", "LNK1293", "LNK1294", "LNK1295", "LNK1297", "LNK1298", "LNK1299", "LNK1300", "LNK1303", "LNK1304", "LNK1305", "LNK1307", "LNK1308", "LNK1310", "LNK1311", "LNK1315", "LNK1316", "LNK1317", "LNK1319", "LNK1320", "LNK1321", "LNK1322", "LNK1323", "LNK1324", "LNK1325", "LNK1327", "LNK1328", "LNK1329", "LNK1330", "LNK1331", "LNK1333", "LNK1334", "LNK1335", "LNK1336", "LNK1337", "LNK1338", "LNK1339", "LNK1340", "LNK1341", "LNK1342", "LNK1343", "LNK1344", "LNK1345", "LNK1346", "LNK1347", "LNK1348", "LNK1349", "LNK1350", "LNK1351", "LNK1353", "LNK1354", "LNK1355", "LNK1356", "LNK1360", "LNK1361", "LNK1362", "LNK1363", "LNK1364", "LNK1365", "LNK1366", "LNK1367", "LNK1368", "LNK1369", "LNK1370", "LNK1371", "LNK1372", "LNK1373", "LNK1375", "LNK1376", "LNK1377", "LNK1378", "LNK1379", "LNK1380", "LNK1381", "LNK1382", "LNK1383", "LNK1384", "LNK1385", "LNK2002", "LNK2003", "LNK2009", "LNK2014", "LNK2015", "LNK2016", "LNK2018", "LNK2021", "LNK2024", "LNK2029", "LNK2030", "LNK2032", "LNK2034", "LNK2035", "LNK2036", "LNK2037", "LNK2040", "LNK2041", "LNK2042", "LNK2043", "LNK2044", "LNK2045", "LNK4003", "LNK4012", "LNK4013", "LNK4017", "LNK4018", "LNK4019", "LNK4030", "LNK4031", "LNK4038", "LNK4040", "LNK4041", "LNK4042", "LNK4043", "LNK4046", "LNK4047", "LNK4048", "LNK4051", "LNK4052", "LNK4056", "LNK4060", "LNK4061", "LNK4062", "LNK4066", "LNK4067", "LNK4068", "LNK4069", "LNK4072", "LNK4077", "LNK4079", "LNK4081", "LNK4085", "LNK4087", "LNK4088", "LNK4093", "LNK4094", "LNK4097", "LNK4103", "LNK4108", "LNK4195", "LNK4196", "LNK4198", "LNK4202", "LNK4203", "LNK4207", "LNK4208", "LNK4209", "LNK4223", "LNK4225", "LNK4226", "LNK4228", "LNK4232", "LNK4233", "LNK4236", "LNK4238", "LNK4239", "LNK4240", "LNK4241", "LNK4242", "LNK4243", "LNK4244", "LNK4245", "LNK4246", "LNK4249", "LNK4250", "LNK4251", "LNK4252", "LNK4255", "LNK4256", "LNK4257", "LNK4258", "LNK4259", "LNK4260", "LNK4261", "LNK4262", "LNK4263", "LNK4264", "LNK4265", "LNK4266", "LNK4267", "LNK4268", "LNK4269", "LNK4270", "LNK4271", "LNK4272", "LNK4273", "LNK4274", "LNK4275", "LNK4276", "LNK4277", "LNK4278", "LNK4279", "LNK4280", "LNK4281", "LNK4282", "LNK4283", "LNK4284", "LNK4285", "LNK4287", "LNK4288", "LNK4289", "LNK4290"]
5+
f1_keywords: ["LNK1100", "LNK1101", "LNK1102", "LNK1105", "LNK1108", "LNK1109", "LNK1111", "LNK1114", "LNK1115", "LNK1117", "LNK1118", "LNK1119", "LNK1121", "LNK1129", "LNK1130", "LNK1131", "LNK1132", "LNK1137", "LNK1144", "LNK1145", "LNK1146", "LNK1147", "LNK1148", "LNK1149", "LNK1154", "LNK1155", "LNK1156", "LNK1159", "LNK1160", "LNK1161", "LNK1162", "LNK1163", "LNK1165", "LNK1167", "LNK1171", "LNK1172", "LNK1173", "LNK1174", "LNK1175", "LNK1178", "LNK1180", "LNK1182", "LNK1183", "LNK1184", "LNK1185", "LNK1186", "LNK1187", "LNK1190", "LNK1194", "LNK1195", "LNK1197", "LNK1198", "LNK1199", "LNK1207", "LNK1209", "LNK1210", "LNK1212", "LNK1213", "LNK1214", "LNK1216", "LNK1219", "LNK1220", "LNK1227", "LNK1229", "LNK1230", "LNK1232", "LNK1233", "LNK1234", "LNK1235", "LNK1236", "LNK1242", "LNK1243", "LNK1244", "LNK1246", "LNK1247", "LNK1249", "LNK1250", "LNK1252", "LNK1253", "LNK1255", "LNK1257", "LNK1258", "LNK1260", "LNK1261", "LNK1262", "LNK1263", "LNK1265", "LNK1266", "LNK1267", "LNK1268", "LNK1269", "LNK1270", "LNK1272", "LNK1274", "LNK1276", "LNK1279", "LNK1280", "LNK1281", "LNK1283", "LNK1285", "LNK1286", "LNK1289", "LNK1290", "LNK1291", "LNK1292", "LNK1293", "LNK1294", "LNK1295", "LNK1297", "LNK1298", "LNK1299", "LNK1300", "LNK1303", "LNK1304", "LNK1305", "LNK1307", "LNK1308", "LNK1310", "LNK1311", "LNK1315", "LNK1316", "LNK1317", "LNK1319", "LNK1320", "LNK1321", "LNK1322", "LNK1323", "LNK1324", "LNK1325", "LNK1327", "LNK1328", "LNK1329", "LNK1330", "LNK1331", "LNK1333", "LNK1334", "LNK1335", "LNK1336", "LNK1337", "LNK1338", "LNK1339", "LNK1340", "LNK1341", "LNK1342", "LNK1343", "LNK1344", "LNK1345", "LNK1346", "LNK1347", "LNK1348", "LNK1349", "LNK1350", "LNK1351", "LNK1353", "LNK1354", "LNK1355", "LNK1356", "LNK1360", "LNK1361", "LNK1362", "LNK1363", "LNK1364", "LNK1365", "LNK1366", "LNK1367", "LNK1368", "LNK1369", "LNK1370", "LNK1371", "LNK1372", "LNK1373", "LNK1375", "LNK1376", "LNK1377", "LNK1378", "LNK1379", "LNK1380", "LNK1381", "LNK1382", "LNK1383", "LNK1384", "LNK1385", "LNK2002", "LNK2003", "LNK2009", "LNK2014", "LNK2015", "LNK2016", "LNK2018", "LNK2021", "LNK2024", "LNK2029", "LNK2030", "LNK2032", "LNK2034", "LNK2035", "LNK2036", "LNK2037", "LNK2040", "LNK2041", "LNK2042", "LNK2043", "LNK2044", "LNK2045", "LNK4003", "LNK4012", "LNK4013", "LNK4017", "LNK4018", "LNK4019", "LNK4030", "LNK4031", "LNK4038", "LNK4040", "LNK4041", "LNK4042", "LNK4043", "LNK4046", "LNK4047", "LNK4048", "LNK4051", "LNK4052", "LNK4056", "LNK4060", "LNK4061", "LNK4062", "LNK4066", "LNK4067", "LNK4068", "LNK4069", "LNK4072", "LNK4077", "LNK4079", "LNK4081", "LNK4085", "LNK4087", "LNK4088", "LNK4093", "LNK4094", "LNK4097", "LNK4103", "LNK4108", "LNK4195", "LNK4196", "LNK4198", "LNK4202", "LNK4203", "LNK4207", "LNK4208", "LNK4209", "LNK4223", "LNK4225", "LNK4226", "LNK4228", "LNK4232", "LNK4233", "LNK4236", "LNK4238", "LNK4239", "LNK4240", "LNK4241", "LNK4242", "LNK4243", "LNK4244", "LNK4245", "LNK4246", "LNK4249", "LNK4250", "LNK4251", "LNK4252", "LNK4255", "LNK4256", "LNK4257", "LNK4258", "LNK4259", "LNK4260", "LNK4261", "LNK4262", "LNK4263", "LNK4264", "LNK4265", "LNK4266", "LNK4267", "LNK4268", "LNK4269", "LNK4270", "LNK4271", "LNK4272", "LNK4273", "LNK4274", "LNK4275", "LNK4276", "LNK4277", "LNK4278", "LNK4279", "LNK4280", "LNK4281", "LNK4282", "LNK4283", "LNK4284", "LNK4285", "LNK4287", "LNK4288", "LNK4289", "LNK4290"]
66
helpviewer_keywords: ["errors [C++]", "linker [C++], errors and warnings", "errors [C++], linker"]
77
ms.assetid: d4b12c0f-4dae-48b2-9b9e-fedf94c94cb0
88
---
@@ -34,6 +34,7 @@ The linker tools LINK, LIB, DUMPBIN, and EDITBIN share a common executable that
3434
[Linker Tools Error LNK1166](../../error-messages/tool-errors/linker-tools-error-lnk1166.md) \
3535
[Linker Tools Error LNK1168](../../error-messages/tool-errors/linker-tools-error-lnk1168.md) \
3636
[Linker Tools Error LNK1169](../../error-messages/tool-errors/linker-tools-error-lnk1169.md) \
37+
[Linker Tools Error LNK1170](../../error-messages/tool-errors/linker-tools-error-lnk1170.md) \
3738
[Linker Tools Error LNK1179](../../error-messages/tool-errors/linker-tools-error-lnk1179.md) \
3839
[Linker Tools Error LNK1181](../../error-messages/tool-errors/linker-tools-error-lnk1181.md) \
3940
[Linker Tools Error LNK1188](../../error-messages/tool-errors/linker-tools-error-lnk1188.md) \

0 commit comments

Comments
 (0)