Skip to content

Commit 082335e

Browse files
TylerMSFTTylerMSFT
authored andcommitted
add a fix for github 4688 - __fastcall parameter passing clarification
1 parent 38c7345 commit 082335e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/cpp/fastcall.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
description: "Learn more about: __fastcall"
33
title: "__fastcall"
4-
ms.date: "12/17/2018"
4+
ms.date: 09/14/2023
55
f1_keywords: ["__fastcall_cpp", "__fastcall", "_fastcall"]
66
helpviewer_keywords: ["__fastcall keyword [C++]"]
7-
ms.assetid: bb5b9c8a-dfad-450c-9119-0ac2bc59544f
87
---
98
# __fastcall
109

@@ -14,10 +13,12 @@ The **`__fastcall`** calling convention specifies that arguments to functions ar
1413

1514
|Element|Implementation|
1615
|-------------|--------------------|
17-
|Argument-passing order|The first two DWORD or smaller arguments that are found in the argument list from left to right are passed in ECX and EDX registers; all other arguments are passed on the stack from right to left.|
16+
|Argument-passing order|The first two `DWORD` or smaller arguments that are found in the argument list from left to right are passed in ECX and EDX registers; all other arguments are passed on the stack from right to left.|
1817
|Stack-maintenance responsibility|Called function pops the arguments from the stack.|
1918
|Name-decoration convention|At sign (\@) is prefixed to names; an at sign followed by the number of bytes (in decimal) in the parameter list is suffixed to names.|
2019
|Case-translation convention|No case translation performed.|
20+
|Classes, structs, and unions|Treated as "multibyte" types (regardless of size) and passed on the stack. |
21+
|Enums and enum classes | Passed by register if their underlying type would be passed by register. For example, if the underlying type is `int` or `unsigned int` of size 8, 16, or 32 bits. |
2122

2223
> [!NOTE]
2324
> Future compiler versions may use different registers to store parameters.
@@ -46,7 +47,7 @@ is equivalent to this:
4647
void __fastcall CMyClass::mymethod() { return; }
4748
```
4849
49-
For compatibility with previous versions, **_fastcall** is a synonym for **`__fastcall`** unless compiler option [/Za \(Disable language extensions)](../build/reference/za-ze-disable-language-extensions.md) is specified.
50+
For compatibility with previous versions, **`_fastcall`** is a synonym for **`__fastcall`** unless compiler option [/Za \(Disable language extensions)](../build/reference/za-ze-disable-language-extensions.md) is specified.
5051
5152
## Example
5253

0 commit comments

Comments
 (0)