Skip to content

Commit 3fd1d6e

Browse files
Updates for GitHub issues
1 parent 6ac7748 commit 3fd1d6e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/preprocessor/fp-contract.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about the fp_contract pragma directive in Microsoft C/C++"
33
title: "fp_contract pragma"
4-
ms.date: 03/15/2022
4+
ms.date: 03/22/2022
55
f1_keywords: ["vc-pragma.fp_contract", "fp_contract_CPP"]
66
helpviewer_keywords: ["pragma, fp_contract", "fp_contract pragma"]
77
no-loc: ["pragma"]
@@ -18,12 +18,12 @@ Determines whether floating-point contraction takes place. A floating-point cont
1818

1919
::: moniker range=">msvc-160"
2020

21-
By default, **`fp_contract`** is **`off`**, which tells the compiler to preserve individual floating-point instructions. Set **`fp_contract`** to **`on`** to use floating-point contraction instructions where possible. This behavior is new in Visual Studio 2022 version 17.0. In previous compiler versions, **`fp_contract`** defaulted to **`on`**.
21+
When you use the default compiler options, **`fp_contract`** is **`off`**, which tells the compiler to preserve individual floating-point instructions. Set **`fp_contract`** to **`on`** to use floating-point contraction instructions where possible. This behavior is new in Visual Studio 2022 version 17.0. In previous compiler versions, **`fp_contract`** defaulted to **`on`**.
2222

2323
::: moniker-end
2424
::: moniker range="<=msvc-160"
2525

26-
By default, **`fp_contract`** is **`on`**. This setting tells the compiler to use floating-point contraction instructions where possible. Set **`fp_contract`** to **`off`** to preserve individual floating-point instructions. In Visual Studio 2022 version 17.0 and later, **`fp_contract`** defaults to **`off`**.
26+
When you use the default compiler options, **`fp_contract`** is **`on`**. This setting tells the compiler to use floating-point contraction instructions where possible. Set **`fp_contract`** to **`off`** to preserve individual floating-point instructions. In Visual Studio 2022 version 17.0 and later, **`fp_contract`** defaults to **`off`**.
2727

2828
::: moniker-end
2929

@@ -41,7 +41,7 @@ The **`/fp:fast`** compiler option enables contractions by default, but the `#pr
4141

4242
```cpp
4343
// pragma_directive_fp_contract.cpp
44-
// on x86 and x64 compile with: /O2 /fp:fast /arch:AVX2
44+
// On x86 and x64 compile with: /O2 /fp:fast /arch:AVX2
4545

4646
#include <stdio.h>
4747

docs/preprocessor/pragma-directives-and-the-pragma-keyword.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
title: "Pragma directives and the __pragma and _Pragma keywords"
33
description: "Describes the pragma directives available in Microsoft Visual C and C++ (MSVC)"
4-
ms.date: 03/15/2022
4+
ms.date: 03/22/2022
55
f1_keywords: ["#pragma", "_Pragma", "__pragma"]
66
helpviewer_keywords: ["#pragma directives, C/C++", "__pragma keyword", "_Pragma keyword", "pragma directives, C/C++", "pragmas, C/C++", "preprocessor", "pragmas", "preprocessor, pragmas", "pragma directives (#pragma)"]
77
no-loc: ["pragma"]
88
---
99
# Pragma directives and the `__pragma` and `_Pragma` keywords
1010

11-
Pragma directives specify machine-specific or operating system-specific compiler features. The **`__pragma`** keyword, which is specific to the Microsoft compiler, enables you to code pragma directives within macro definitions. The standard **`_Pragma`** preprocessor operator was introduced in C99 and adopted by C++11.
11+
Pragma directives specify machine-specific or operating system-specific compiler features. A line that starts with `#pragma` specifies a pragma directive. The Microsoft-specific **`__pragma`** keyword enables you to code pragma directives within macro definitions. The standard **`_Pragma`** preprocessor operator, introduced in C99 and adopted by C++11, is similar.
1212

1313
## Syntax
1414

1515
> **`#pragma`** *token-string*\
16-
> **`__pragma(`** *token-string* **`)`** // two leading underscores - Microsoft specific extension\
16+
> **`__pragma(`** *token-string* **`)`** // two leading underscores - Microsoft-specific extension\
1717
> **`_Pragma(`** *string-literal* **`)`** // C99
1818
1919
## Remarks
@@ -142,7 +142,7 @@ Quotation marks and back-slashes should be escaped, as shown above. A pragma str
142142
143143
The following code example demonstrates how the **`_Pragma`** keyword could be used in an assert-like macro. It creates a pragma directive that suppresses a warning when the condition expression happens to be constant.
144144
145-
The macro definition uses the `do`-`while(0)` idiom for multi-statement macros so that it can be used as though it were one statement. For more information, see [C multi-line macro](https://stackoverflow.com/questions/1067226/c-multi-line-macro-do-while0-vs-scope-block) on Stack Overflow. The **`_Pragma`** statement in the example only applies to the line of code that follows it.
145+
The macro definition uses the `do ... while(0)` idiom for multi-statement macros so that it can be used as though it were one statement. For more information, see [C multi-line macro](https://stackoverflow.com/questions/1067226/c-multi-line-macro-do-while0-vs-scope-block) on Stack Overflow. The **`_Pragma`** statement in the example only applies to the line of code that follows it.
146146
147147
```C
148148
// Compile with /W4

0 commit comments

Comments
 (0)