Skip to content

Commit fe00e93

Browse files
authored
Merge pull request #5272 from Rageking8/update-c4799-warning-page
Update C4799 warning page
2 parents fdbdbae + b91840e commit fe00e93

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed
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)