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/build/overview-of-arm-abi-conventions.md
-22Lines changed: 0 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -38,28 +38,6 @@ The instruction set for Windows on ARM is strictly limited to Thumb-2. All code
38
38
39
39
A side-effect of this requirement is that all code pointers must have the low bit set. Then, when they're loaded and branched to via BLX or BX, the processor remains in Thumb mode. It doesn't try to execute the target code as 32-bit ARM instructions.
40
40
41
-
### IT Instructions
42
-
43
-
The use of IT instructions in Thumb-2 code is disallowed except for these specific cases:
44
-
45
-
- The IT instruction can only be used to modify one target instruction.
46
-
47
-
- The target must be one of these 16-bit instructions:
Although current ARMv7 CPUs can't report the use of disallowed instruction forms, future generations are expected to. If these forms are detected, any program that uses them may be terminated with an undefined instruction exception.
62
-
63
41
### SDIV/UDIV instructions
64
42
65
43
The use of integer divide instructions SDIV and UDIV is fully supported, even on platforms without native hardware to handle them. The extra overhead per SDIV or UDIV divide on a Cortex-A9 processor is approximately 80 cycles. That's added to the overall divide time of 20-250 cycles, depending on the inputs.
description: "Reference for Microsoft C++ Code Analysis warning C26826 in Visual Studio."
4
+
ms.date: 10/25/2021
5
+
f1_keywords: ["C26826"]
6
+
helpviewer_keywords: ["C26826"]
7
+
---
8
+
# C26826
9
+
10
+
> Don't use C-style variable arguments (f.55).
11
+
12
+
For more information, see [F.55: Don't use `va_arg` arguments](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#F-varargs) in the C++ Core Guidelines.
13
+
14
+
## Remarks
15
+
16
+
This check warns on all usages of `va_list`, `va_start`, `va_arg`, and `va_end`, discouraging the use of C-style variable arguments. C-style variable arguments are unsafe because they require the programmer to assume that the arguments are all passed and read with the correct types.
17
+
18
+
Warning C26826 is available starting in Visual Studio 2022 version 17.1.
19
+
20
+
## Example
21
+
22
+
```cpp
23
+
intsum(int n, ...) {
24
+
va_list l; // C26826 Don't use C-style variable arguments
25
+
va_start(l, n); // C26826 Don't use C-style variable arguments
26
+
27
+
int s = 0;
28
+
for (int i = 0; i < n; ++i) {
29
+
// BAD, assumes the variable arguments will be passed as ints
30
+
s += va_arg(l, int); // C26826 Don't use C-style variable arguments
31
+
}
32
+
33
+
va_end(l); // C26826 Don't use C-style variable arguments
34
+
return s;
35
+
}
36
+
37
+
int main() {
38
+
sum(2, 1, 2, 3); // ok
39
+
sum(2, 1.5, 3.14159, 2.71828); // BAD, undefined
40
+
}
41
+
```
42
+
43
+
Alternatives to C-style variable arguments include:
Allocates memory for an object or array of objects of *type-name* from the free store and returns a suitably typed, nonzero pointer to the object.
10
+
Allocates memory for an object or array of objects of *type-name* from the free store, commonly called the "heap", and returns a suitably typed, nonzero pointer to the object.
11
11
12
12
> [!NOTE]
13
13
> Microsoft C++ Component Extensions provides support for the **`new`** keyword to add vtable slot entries. For more information, see [new (new slot in vtable)](../extensions/new-new-slot-in-vtable-cpp-component-extensions.md)
\* You can use the Windows XP platform toolset included in Visual Studio 2017, Visual Studio 2015, Visual Studio 2013, and Visual Studio 2012 Update 1 to build Windows XP and Windows Server 2003 projects. For information on how to use this platform toolset, see [Configuring Programs for Windows XP](../build/configuring-programs-for-windows-xp.md). For additional information on changing the platform toolset, see [How to: Modify the Target Framework and Platform Toolset](../build/how-to-modify-the-target-framework-and-platform-toolset.md).
30
-
31
-
\*\* You can install the **Mobile development with C++** workload in the installer for Visual Studio 2017 and later. In Visual Studio 2015 setup, choose the optional **Visual C++ for Cross Platform Mobile Development** component to target iOS or Android platforms. For instructions, see [Install Visual C++ for Cross-Platform Mobile Development](/visualstudio/cross-platform/install-visual-cpp-for-cross-platform-mobile-development). To build iOS code, you must have a Mac computer and meet other requirements. For a list of prerequisites and installation instructions, see [Install And Configure Tools to Build using iOS](/visualstudio/cross-platform/install-and-configure-tools-to-build-using-ios). You can build x86 or ARM code to match the target hardware. Use x86 configurations to build for the iOS simulator, Microsoft Visual Studio Emulator for Android, and some Android devices. Use ARM configurations to build for iOS devices and most Android devices.
32
-
33
-
\*\*\* You can install the **Linux development with C++** workload in the installer for Visual Studio 2017 and later to target Linux platforms. For instructions, see [Download, Install and Setup the Linux Workload](../linux/download-install-and-setup-the-linux-development-workload.md). This toolset compiles your executable on the target machine, so you can build for any supported architecture.
34
-
35
-
\*\*\*\* ARM64 support is available in Visual Studio 2017 and later.
36
-
37
-
For information about how to set the target platform configuration, see [How to: Configure Visual C++ Projects to Target 64-Bit, x64 Platforms](../build/how-to-configure-visual-cpp-projects-to-target-64-bit-platforms.md).
13
+
| Operating System | x86 | x64 | ARM | ARM64<sup>a</sup> |
14
+
|--|--|--|--|--|
15
+
| Windows XP<sup>xp</sup> | X | X |||
16
+
| Windows Vista | X | X |||
17
+
| Windows 7 | X | X |||
18
+
| Windows 8 | X | X | X ||
19
+
| Windows 8.1 | X | X | X ||
20
+
| Windows 10 | X | X | X | X |
21
+
| Windows 11 | X | X | X | X |
22
+
| Windows Server 2003<sup>xp</sup> | X | X |||
23
+
| Windows Server 2008 R2 | X | X |||
24
+
| Windows Server 2012 R2 | X | X |||
25
+
| Windows Server 2016 | X | X |||
26
+
| Windows Server 2019 | X | X |||
27
+
| Windows Server 2022 | X | X |||
28
+
| Android<sup>m</sup> | X | X | X | X |
29
+
| iOS<sup>m</sup> | X | X | X | X |
30
+
| Linux<sup>l</sup> | X | X | X | X |
31
+
32
+
<sup>xp</sup> You can use the Windows XP platform toolsets included in Visual Studio 2017, Visual Studio 2015, Visual Studio 2013, and Visual Studio 2012 Update 1 to build Windows XP and Windows Server 2003 projects. For information on how to use these platform toolsets, see [Configuring Programs for Windows XP](../build/configuring-programs-for-windows-xp.md). For more information on changing the platform toolset, see [How to: Modify the Target Framework and Platform Toolset](../build/how-to-modify-the-target-framework-and-platform-toolset.md).
33
+
34
+
<sup>m</sup> You can install the **Mobile development with C++** workload in the installer for Visual Studio 2017 and later. In Visual Studio 2015 setup, choose the optional **Visual C++ for Cross Platform Mobile Development** component to target iOS or Android platforms. For instructions, see [Install Visual C++ for Cross-Platform Mobile Development](/visualstudio/cross-platform/install-visual-cpp-for-cross-platform-mobile-development). To build iOS code, you must have a Mac computer and meet other requirements. For a list of prerequisites and installation instructions, see [Install And Configure Tools to Build using iOS](/visualstudio/cross-platform/install-and-configure-tools-to-build-using-ios). You can build x86 or ARM code to match the target hardware. Use x86 configurations to build for some Android devices. Use ARM configurations to build for iOS devices and most Android devices.
35
+
36
+
<sup>l</sup> You can install the **Linux development with C++** workload in the installer for Visual Studio 2017 and later to target Linux platforms. For instructions, see [Download, install, and setup the Linux Workload](../linux/download-install-and-setup-the-linux-development-workload.md). This toolset compiles your executable on the target machine, so you can build for any supported architecture.
37
+
38
+
<sup>a</sup> ARM64 support is available in Visual Studio 2017 and later.
39
+
40
+
For information about how to set the target platform configuration, see [How to: Configure Visual C++ Projects to Target 64-bit, x64 Platforms](../build/how-to-configure-visual-cpp-projects-to-target-64-bit-platforms.md).
38
41
39
42
## See also
40
43
41
-
-[Visual C++ Tools and Features in Visual Studio Editions](visual-cpp-tools-and-features-in-visual-studio-editions.md)
0 commit comments