Skip to content

Commit 4bbd0cf

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#3896 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master)
2 parents d2ae840 + c294c68 commit 4bbd0cf

4 files changed

Lines changed: 52 additions & 27 deletions

File tree

docs/build/overview-of-arm-abi-conventions.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,6 @@ The instruction set for Windows on ARM is strictly limited to Thumb-2. All code
3838

3939
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.
4040

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:
48-
49-
|16-Bit Opcodes|Class|Restrictions|
50-
|---------------------|-----------|------------------|
51-
|MOV, MVN|Move|`Rm != PC`, `Rd != PC`|
52-
|LDR, LDR[S]B, LDR[S]H|Load from memory|But not LDR literal forms|
53-
|STR, STRB, STRH|Store to memory||
54-
|ADD, ADC, RSB, SBC, SUB|Add or subtract|But not ADD/SUB SP, SP, imm7 forms<br /><br /> `Rm != PC`, `Rdn != PC`, `Rdm != PC`|
55-
|CMP, CMN|Compare|`Rm != PC`, `Rn != PC`|
56-
|MUL|Multiply||
57-
|ASR, LSL, LSR, ROR|Bit shift||
58-
|AND, BIC, EOR, ORR, TST|Bitwise arithmetic||
59-
|BX|Branch to register|`Rm != PC`|
60-
61-
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-
6341
### SDIV/UDIV instructions
6442

6543
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.

docs/code-quality/c26826.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: C26826
3+
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+
int sum(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:
44+
- function overloading
45+
- variadic templates
46+
- `std::variant` arguments
47+
- `std::initializer_list`

docs/cpp/new-operator-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.assetid: 69fee812-1c28-4882-8fda-d1ad17860004
77
---
88
# new Operator (C++)
99

10-
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.
1111

1212
> [!NOTE]
1313
> 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)

docs/windows/latest-supported-vc-redist.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Download additional languages and versions, including for long term servicing re
3131

3232
| Architecture | Link | Notes |
3333
|--|:-:|-:|
34-
| ARM64 | [https://aka.ms/vs/16/release/vc_redist.arm64.exe](https://aka.ms/vs/16/release/vc_redist.arm64.exe) | Permalink for latest supported ARM64 version |
35-
| X86 | [https://aka.ms/vs/16/release/vc_redist.x86.exe](https://aka.ms/vs/16/release/vc_redist.x86.exe) | Permalink for latest supported x86 version |
36-
| X64 | [https://aka.ms/vs/16/release/vc_redist.x64.exe](https://aka.ms/vs/16/release/vc_redist.x64.exe) | Permalink for latest supported x64 version. To make it easy to install required Visual C++ ARM64 binaries when the X64 redistributable is installed on an ARM64 device, the X64 redistributable package contains both ARM64 and X64 binaries |
34+
| ARM64 | [https://aka.ms/vs/17/release/vc_redist.arm64.exe](https://aka.ms/vs/17/release/vc_redist.arm64.exe) | Permalink for latest supported ARM64 version |
35+
| X86 | [https://aka.ms/vs/17/release/vc_redist.x86.exe](https://aka.ms/vs/17/release/vc_redist.x86.exe) | Permalink for latest supported x86 version |
36+
| X64 | [https://aka.ms/vs/17/release/vc_redist.x64.exe](https://aka.ms/vs/17/release/vc_redist.x64.exe) | Permalink for latest supported x64 version. To make it easy to install required Visual C++ ARM64 binaries when the X64 redistributable is installed on an ARM64 device, the X64 redistributable package contains both ARM64 and X64 binaries |
3737

3838
### Notes
3939

40-
- Visual Studio versions since Visual Studio 2015 share the same redistributable files. For example, the latest Microsoft Visual C++ Redistributable can be used by apps built using the Visual Studio 2015, 2017, or 2019 toolsets. However, the version of the Microsoft Visual C++ redistributable installed on the machine must be the same or higher than the version of the Visual C++ toolset used to create your application. For more information about which version of the Redistributable to install, see [Determining Which DLLs to Redistribute](determining-which-dlls-to-redistribute.md).
40+
- Visual Studio versions since Visual Studio 2015 share the same redistributable files. For example, the latest Microsoft Visual C++ Redistributable can be used by apps built using the Visual Studio 2015, 2017, 2019, or 2022 toolsets. However, the version of the Microsoft Visual C++ redistributable installed on the machine must be the same or higher than the version of the Visual C++ toolset used to create your application. For more information about which version of the Redistributable to install, see [Determining Which DLLs to Redistribute](determining-which-dlls-to-redistribute.md).
4141

4242
- **Windows XP Support**: Microsoft ended support for Windows XP on April 8, 2014. While the current version of the Visual C++ Redistributable for Visual Studio 2015-2019 only supports Windows Vista, 7, 8.1, 10, and 11, older versions of the C++ Redistributable can be installed on Windows XP. The last version of the C++ Redistributable for Visual Studio 2015-2019 that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with **14.27**). The redistributable file is available in the [my.visualstudio.com](https://my.visualstudio.com/) Downloads section, as [Visual C++ Redistributable for Visual Studio 2019 - Version 16.7](https://my.visualstudio.com/Downloads?q=Redistributable%20for%20Visual%20Studio%202019%20Version%2016.7). To download the files, select the platform and language you need, and then choose the Download button.
4343

0 commit comments

Comments
 (0)