Skip to content

Commit ee9b209

Browse files
authored
Merge pull request #5856 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main)
2 parents 5685566 + fe00e93 commit ee9b209

File tree

5 files changed

+44
-31
lines changed

5 files changed

+44
-31
lines changed
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
---
2-
description: "Learn more about: Link Options"
3-
title: "Link Options"
2+
title: "Link options"
3+
description: "Learn more about: Link options"
44
ms.date: "11/04/2016"
55
helpviewer_keywords: ["nothrownew.obj", "newmode.obj", "noenv.obj", "psetargv.obj", "legacy_stdio_float_rounding.obj", "loosefpmath.obj", "smallheap.obj", "fp10.obj", "nochkclr.obj", "chkstk.obj", "pcommode.obj", "pnoenv.obj", "link options [C++]", "invalidcontinue.obj", "pnothrownew.obj", "pwsetargv.obj", "pinvalidcontinue.obj", "wsetargv.obj", "binmode.obj", "setargv.obj", "noarg.obj", "pnewmode.obj", "commode.obj", "pthreadlocale.obj", "pbinmode.obj", "threadlocale.obj", "pnoarg.obj"]
6-
ms.assetid: 05b5a77b-9dd1-494b-ae46-314598c770bb
76
---
87
# Link options
98

109
The CRT lib directory includes several small object files that enable specific CRT features without code changes. These object files are called "link options" because you only have to add them to the linker command line to use them. To do this from Visual Studio, in the Solution Explorer right-click your project and choose **Properties**. Under **Configuration Properties**, choose **Linker** > **Input** > **Additional Dependencies** and specify the additional items to add to the link command line.
1110

12-
CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017. Use the regular versions for native and `/clr` code.
11+
CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017. Use the regular versions for native and [`/clr`](../build/reference/clr-common-language-runtime-compilation.md) code.
1312

1413
| Native and /clr | Pure mode | Description |
1514
|---|---|---|
16-
| `binmode.obj` | `pbinmode.obj` | Sets the default file-translation mode to binary. See [`_fmode`](./fmode.md). |
15+
| `binmode.obj` | `pbinmode.obj` | Sets the default file-translation mode to binary. See [`_fmode`](fmode.md). |
1716
| `chkstk.obj` | n/a | Provides stack-checking and alloca support when not using the CRT. |
18-
| `commode.obj` | `pcommode.obj` | Sets the global commit flag to "commit". See [`fopen`, `_wfopen`](./reference/fopen-wfopen.md) and [`fopen_s`, `_wfopen_s`](./reference/fopen-s-wfopen-s.md). |
19-
| exe_initialize_mta.lib | n/a | Initializes the MTA apartment during EXE startup, which allows the use of COM objects in global smart pointers. Because this option leaks an MTA apartment reference during shutdown, don't use it for DLLs. Linking to this file is equivalent to including `combase.h` and defining `_EXE_INITIALIZE_MTA`. Using this link option adds [onecore.lib](/windows/win32/apiindex/windows-umbrella-libraries) to the default library list. If this effect is undesirable (such as using onecore_apiset.lib or other umbrella library), use [/NODEFAULTLIB](../build/reference/nodefaultlib-ignore-libraries.md) to override this behavior and provide an alternative. |
20-
| `fp10.obj` | n/a | Changes the default precision control to 64 bits. See [Math and floating-point support](./floating-point-support.md). |
17+
| `commode.obj` | `pcommode.obj` | Sets the global commit flag to "commit". See [`fopen`, `_wfopen`](reference/fopen-wfopen.md) and [`fopen_s`, `_wfopen_s`](reference/fopen-s-wfopen-s.md). |
18+
| `exe_initialize_mta.lib` | n/a | Initializes the MTA apartment during EXE startup, which allows the use of COM objects in global smart pointers. Because this option leaks an MTA apartment reference during shutdown, don't use it for DLLs. Linking to this file is equivalent to including `combase.h` and defining `_EXE_INITIALIZE_MTA`. Using this link option adds [`onecore.lib`](/windows/win32/apiindex/windows-umbrella-libraries) to the default library list. If this effect is undesirable (such as using onecore_apiset.lib or other umbrella library), use [`/NODEFAULTLIB`](../build/reference/nodefaultlib-ignore-libraries.md) to override this behavior and provide an alternative. |
19+
| `fp10.obj` | n/a | Changes the default precision control to 64 bits. See [Math and floating-point support](floating-point-support.md). |
2120
| `invalidcontinue.obj` | `pinvalidcontinue.obj` | Sets a default invalid parameter handler that does nothing, meaning that invalid parameters passed to CRT functions will just set errno and return an error result. |
22-
| `legacy_stdio_float_rounding.obj` | n/a | The printing of floating-point values (for example, when using [`printf`](./reference/printf-printf-l-wprintf-wprintf-l.md)) with the Windows 10 19041 Universal C Runtime has been fixed. It now properly rounds exactly representable floating-point numbers, and respects the floating-point rounding requested by [`fesetround`](./reference/fegetround-fesetround2.md). This behavior update is available in Visual Studio 2019 version 16.2 and later. Legacy behavior is used in earlier versions of Visual Studio, or by providing this link option. |
21+
| `legacy_stdio_float_rounding.obj` | n/a | The printing of floating-point values (for example, when using [`printf`](reference/printf-printf-l-wprintf-wprintf-l.md)) with the Windows 10 19041 Universal C Runtime has been fixed. It now properly rounds exactly representable floating-point numbers, and respects the floating-point rounding requested by [`fesetround`](reference/fegetround-fesetround2.md). This behavior update is available in Visual Studio 2019 version 16.2 and later. Legacy behavior is used in earlier versions of Visual Studio, or by providing this link option. |
2322
| `loosefpmath.obj` | n/a | Ensures that floating point code tolerates denormal values. |
24-
| `newmode.obj` | `pnewmode.obj` | Causes [`malloc`](./reference/malloc.md) to call the new handler on failure. See [`_set_new_mode`](./reference/set-new-mode.md), [`_set_new_handler`](./reference/set-new-handler.md), [`calloc`](./reference/calloc.md), and [`realloc`](./reference/realloc.md). |
23+
| `newmode.obj` | `pnewmode.obj` | Causes [`malloc`](reference/malloc.md) to call the new handler on failure. See [`_set_new_mode`](reference/set-new-mode.md), [`_set_new_handler`](reference/set-new-handler.md), [`calloc`](reference/calloc.md), and [`realloc`](reference/realloc.md). |
2524
| `noarg.obj` | `pnoarg.obj` | Disables all processing of argc and argv. |
2625
| `nochkclr.obj` | n/a | Does nothing. Remove from your project. |
2726
| `noenv.obj` | `pnoenv.obj` | Disables the creation of a cached environment for the CRT. |
@@ -32,4 +31,4 @@ CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and
3231

3332
## See also
3433

35-
- [C runtime (CRT) and C++ Standard Library (STL) `.lib` files](./crt-library-features.md)
34+
- [C runtime (CRT) and C++ Standard Library (STL) `.lib` files](crt-library-features.md)
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4556"
32
title: "Compiler Warning (level 1) C4556"
4-
ms.date: "08/27/2018"
3+
description: "Learn more about: Compiler Warning (level 1) C4556"
4+
ms.date: "03/28/2025"
55
f1_keywords: ["C4556"]
66
helpviewer_keywords: ["C4556"]
7-
ms.assetid: e4c0e296-b747-4db1-9608-30b8b74feac2
87
---
98
# Compiler Warning (level 1) C4556
109

11-
> value of intrinsic immediate argument '*value*' is out of range '*lowerbound* - *upperbound*'
10+
> value of intrinsic immediate argument '*value*' is out of range '*lower_bound* - *upper_bound*'
1211
1312
## Remarks
1413

1514
An intrinsic matches a hardware instruction. The hardware instruction has a fixed number of bits to encode the constant. If *value* is out of range, it will not encode properly. The compiler truncates the extra bits.
1615

1716
## Example
1817

19-
The following sample generates C4556:
18+
The following example generates C4556:
2019

2120
```cpp
2221
// C4556.cpp
2322
// compile with: /W1
24-
// processor: x86 IPF
23+
// processor: x86
2524
#include <xmmintrin.h>
2625

27-
void test()
28-
{
29-
__m64 m;
30-
_m_pextrw(m, 5); // C4556
31-
}
32-
3326
int main()
3427
{
28+
__m64 m = _mm_setzero_si64();
29+
_m_pextrw(m, 5); // C4556
30+
_mm_empty();
3531
}
3632
```
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4799"
32
title: "Compiler Warning (level 1) C4799"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4799"
4+
ms.date: "03/28/2025"
55
f1_keywords: ["C4799"]
66
helpviewer_keywords: ["C4799"]
7-
ms.assetid: 8ecbd06f-c778-4371-a2fb-c690b6743ec8
87
---
98
# Compiler Warning (level 1) C4799
109

11-
> No EMMS at end of function '*function*'
10+
> function '*function*' has no EMMS instruction
1211
13-
The function has at least one MMX instruction, but does not have an `EMMS` instruction. When a multimedia instruction is used, an `EMMS` instruction or `_mm_empty` intrinsic should also be used to clear the multimedia tag word at the end of the MMX code.
12+
The function has at least one MMX instruction, but does not have an `EMMS` instruction. When a multimedia instruction is used, an `EMMS` instruction or [`_mm_empty`](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_empty) intrinsic should also be used to clear the multimedia tag word at the end of the MMX code.
1413

15-
You may get C4799 when using ivec.h, indicating that the code does not use properly execute the EMMS instruction before returning. This is a false warning for these headers. You may turn these off by defining _SILENCE_IVEC_C4799 in ivec.h. However, be aware that this will also keep the compiler from giving correct warnings of this type.
14+
You may get C4799 when using `ivec.h`, indicating that the code does not properly execute the `EMMS` instruction before returning. This is a false warning for these headers. You may turn these off by defining `_SILENCE_IVEC_C4799` in `ivec.h`. However, be aware that this will also keep the compiler from giving correct warnings of this type.
1615

1716
For related information, see [Intel's MMX Instruction Set](../../assembler/inline/intel-s-mmx-instruction-set.md).
17+
18+
## Example
19+
20+
The following example generates C4799:
21+
22+
```cpp
23+
// C4799.cpp
24+
// compile with: /W1
25+
// processor: x86
26+
#include <mmintrin.h>
27+
28+
int main()
29+
{
30+
__m64 m = _mm_setzero_si64();
31+
32+
// Uncomment the following line to resolve the warning:
33+
// _mm_empty();
34+
} // C4799
35+
```

docs/error-messages/compiler-warnings/compiler-warnings-by-compiler-version.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ These warnings, and all warnings in later versions, are suppressed by using the
953953
| [C4792](compiler-warning-level-3-c4792.md) | `function 'function' declared using sysimport and referenced from native code; import library required to link` |
954954
| [C4794](compiler-warning-level-1-c4794.md) | `segment of thread local storage variable 'name' changed from 'segment' to 'segment'` |
955955
| C4798 | `native code generated for p-code function 'name' with exception handler or unwind semantics` |
956-
| [C4799](compiler-warning-level-1-c4799.md) | `function 'name' has no EMMS instruction` |
956+
| [C4799](compiler-warning-level-1-c4799.md) | `function 'function' has no EMMS instruction` |
957957
| [C4803](compiler-warning-level-1-c4803.md) | `'declaration': the raise method has a different storage class from that of the event, 'declaration'` |
958958
| [C4810](compiler-warning-level-1-c4810.md) | `value of pragma pack(show) == number` |
959959
| [C4811](compiler-warning-level-1-c4811.md) | `value of pragma conform(forScope, show) == value` |

docs/error-messages/compiler-warnings/compiler-warnings-c4600-through-c4799.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ The articles in this section describe Microsoft C/C++ compiler warning messages
170170
|[Compiler warning (level 1 and level 3) C4793](compiler-warning-level-1-and-3-c4793.md)|'*function*': function compiled as native:<br> *reason*|
171171
|[Compiler warning (level 1) C4794](compiler-warning-level-1-c4794.md)|segment of thread local storage variable '%s' changed from '%s' to '%s'|
172172
|Compiler warning C4798|native code generated for p-code function 'name' with exception handler or unwind semantics|
173-
|[Compiler warning (level 1) C4799](compiler-warning-level-1-c4799.md)|function 'function' has no `EMMS` instruction|
173+
|[Compiler warning (level 1) C4799](compiler-warning-level-1-c4799.md)|function '*function*' has no EMMS instruction|
174174

175175
## See also
176176

0 commit comments

Comments
 (0)