Skip to content

Commit 8c1762a

Browse files
authored
Merge pull request #5732 from Rageking8/structure-warning-references-in-range-c4751-c4830
Structure warning references in range [C4751, C4830]
2 parents ace7ac3 + b6229c8 commit 8c1762a

30 files changed

+184
-134
lines changed

docs/error-messages/compiler-warnings/c4768.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 3) C4768"
32
title: "Compiler Warning (level 3) C4768"
3+
description: "Learn more about: Compiler Warning (level 3) C4768"
44
ms.date: 05/03/2021
55
f1_keywords: ["C4768"]
66
helpviewer_keywords: ["C4768"]
@@ -9,10 +9,10 @@ helpviewer_keywords: ["C4768"]
99

1010
> `__declspec` attributes before linkage specification are ignored
1111
12-
The compiler warns if `__declspec(...)` is applied before the `extern "C"` linkage specification. Previously, the compiler would ignore the attribute, which could have runtime implications.
13-
1412
## Remarks
1513

14+
The compiler warns if `__declspec(...)` is applied before the `extern "C"` linkage specification. Previously, the compiler would ignore the attribute, which could have runtime implications.
15+
1616
This warning is new in Visual Studio 2017 version 15.3, which left it off by default. It's enabled by default as a level 3 warning starting in Visual Studio 2017 version 15.5. For information on how to disable warnings by compiler version, see [Compiler warnings by compiler version](compiler-warnings-by-compiler-version.md).
1717

1818
## Example

docs/error-messages/compiler-warnings/c4770.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4770"
32
title: "Compiler Warning (level 4) C4770"
3+
description: "Learn more about: Compiler Warning (level 4) C4770"
44
ms.date: 11/02/2022
55
f1_keywords: ["C4770"]
66
helpviewer_keywords: ["C4770"]
@@ -9,10 +9,10 @@ helpviewer_keywords: ["C4770"]
99

1010
> partially validated enum '*symbol*' used as index
1111
12-
The compiler warns if an enum value is cast or aliased to an integer type, but the result isn't checked for non-negative or excessive values.
13-
1412
## Remarks
1513

14+
The compiler warns if an enum value is cast or aliased to an integer type, but the result isn't checked for non-negative or excessive values.
15+
1616
This warning is new in Visual Studio 2013. It's not enabled by default. To enable it as a level 1 warning, use `/w14770`. For information on how to disable warnings by compiler version, see [Compiler warnings by compiler version](compiler-warnings-by-compiler-version.md).
1717

1818
## Example

docs/error-messages/compiler-warnings/compiler-warning-level-1-and-3-c4793.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1 and 3) C4793"
32
title: "Compiler Warning (level 1 and 3) C4793"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1 and 3) C4793"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4793"]
66
helpviewer_keywords: ["C6634", "C6635", "C6640", "C6630", "C6639", "C6636", "C6638", "C6631", "C6637", "C4793"]
7-
ms.assetid: 819ada53-1d9c-49b8-a629-baf8c12314e6
87
---
98
# Compiler Warning (level 1 and 3) C4793
109

@@ -30,9 +29,9 @@ The following table lists all possible continuation messages.
3029
|A non-__clrcall virtual function thunk must be compiled as native|A non-[__clrcall](../../cpp/clrcall.md) virtual function thunk must use an unmanaged address.|
3130
|A function using '_setjmp' must be compiled as native|The CLR must be able to control program execution. However, the [setjmp](../../cpp/using-setjmp-longjmp.md) function bypasses regular program execution by saving and restoring low-level information such as registers and execution state.|
3231

33-
## Example
32+
## Examples
3433

35-
The following sample generates C4793.
34+
The following example generates C4793.
3635

3736
```cpp
3837
// C4793.cpp
@@ -50,7 +49,7 @@ warning C4793: 'asmfunc' : function is compiled as native code:
5049
Inline native assembly ('__asm') is not supported in managed code
5150
```
5251

53-
The following sample generates C4793.
52+
The following example generates C4793.
5453

5554
```cpp
5655
// C4793_b.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4772.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4772"
32
title: "Compiler Warning (level 1) C4772"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4772"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4772"]
66
helpviewer_keywords: ["C4772"]
7-
ms.assetid: dafe6fd8-9faf-41f5-9d66-a55838742c14
87
---
98
# Compiler Warning (level 1) C4772
109

11-
> \#import referenced a type from a missing type library; '*missing-type*' used as a placeholder
10+
> #import referenced a type from a missing type library; '*missing-type*' used as a placeholder
11+
12+
## Remarks
1213

1314
A type library was referenced with the [#import](../../preprocessor/hash-import-directive-cpp.md) directive. However, the type library contained a reference to another type library that was not referenced with `#import`. This other .tlb file was not found by the compiler.
1415

@@ -51,7 +52,7 @@ library C4772bLib
5152
};
5253
```
5354

54-
The following sample generates C4772:
55+
The following example generates C4772:
5556

5657
```cpp
5758
// C4772.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4788.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
---
2-
description: "Learn more about: Compiler Warning (Level 1) C4788"
32
title: "Compiler Warning (Level 1) C4788"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (Level 1) C4788"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4788"]
66
helpviewer_keywords: ["C4788"]
7-
ms.assetid: 47d75bda-f833-4bdd-93a0-a134df0cd303
87
---
98
# Compiler Warning (Level 1) C4788
109

11-
'identifier' : identifier was truncated to 'number' characters
10+
> 'identifier' : identifier was truncated to 'number' characters
11+
12+
## Remarks
1213

1314
The compiler limits the maximum length allowed for a function name. When the compiler generates funclets for EH/SEH code, it forms the funclet name by prepending the function name with some text, for example "__catch", "\__unwind", or another string.
1415

1516
The resulting funclet name can be too long, and the compiler will truncate it and generate C4788.
1617

17-
To resolve this warning, shorten the original function name. If the function is a C++ function template or method, use a typedef for part of the name. For example:
18+
To resolve this warning, shorten the original function name. If the function is a C++ function template or method, use a typedef for part of the name.
19+
20+
## Example
21+
22+
For example:
1823

1924
```cpp
2025
C1<x, y, z<T>>::C2<a,b,c>::f

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4789.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The [`/sdl` (Enable Additional Security Checks)](../../build/reference/sdl-enabl
3838

3939
## Examples
4040

41-
The following sample generates C4789:
41+
The following example generates C4789:
4242

4343
```cpp
4444
// C4789.cpp
@@ -60,7 +60,7 @@ int main()
6060
}
6161
```
6262

63-
The following sample also generates C4789:
63+
The following example also generates C4789:
6464

6565
```cpp
6666
// C4789b.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4794.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4794"
32
title: "Compiler Warning (level 1) C4794"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4794"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4794"]
66
helpviewer_keywords: ["C4794"]
7-
ms.assetid: badc9c36-fa1a-4fec-929b-7bfda7a7b79f
87
---
98
# Compiler Warning (level 1) C4794
109

11-
segment of thread local storage variable 'variable' changed from 'section name' to '.tls$'
10+
> segment of thread local storage variable 'variable' changed from 'section name' to '.tls$'
11+
12+
## Remarks
1213

1314
You used [#pragma data_seg](../../preprocessor/data-seg.md) to put a tls variable in a section not starting with .tls$.
1415

1516
The .tls$*x* section will exist in the object file where [__declspec(thread)](../../cpp/thread.md) variables are defined. A .tls section in the EXE or DLL will result from these sections.
1617

1718
## Example
1819

19-
The following sample generates C4794:
20+
The following example generates C4794:
2021

2122
```cpp
2223
// C4794.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4799.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
22
title: "Compiler Warning (level 1) C4799"
33
description: "Learn more about: Compiler Warning (level 1) C4799"
4-
ms.date: "03/28/2025"
4+
ms.date: 03/28/2025
55
f1_keywords: ["C4799"]
66
helpviewer_keywords: ["C4799"]
77
---
88
# Compiler Warning (level 1) C4799
99

1010
> function '*function*' has no EMMS instruction
1111
12+
## Remarks
13+
1214
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.
1315

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

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4803.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4803"
32
title: "Compiler Warning (level 1) C4803"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4803"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4803"]
66
helpviewer_keywords: ["C4803"]
7-
ms.assetid: 2552f3a6-c418-49f4-98a2-a929857be658
87
---
98
# Compiler Warning (level 1) C4803
109

11-
'method' : the raise method has a different storage class from that of the event, 'event'
10+
> 'method' : the raise method has a different storage class from that of the event, 'event'
11+
12+
## Remarks
1213

1314
Event methods must have the same storage class as the event declaration. The compiler adjusts the event's methods so that the storage classes are the same.
1415

@@ -18,7 +19,7 @@ See [warning](../../preprocessor/warning.md) pragma for information on how to tu
1819

1920
## Example
2021

21-
The following sample generates C4803.
22+
The following example generates C4803.
2223

2324
```cpp
2425
// C4803.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4804.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4804"
32
title: "Compiler Warning (level 1) C4804"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4804"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4804"]
66
helpviewer_keywords: ["C4804"]
7-
ms.assetid: 069e8f44-3ef6-43bb-8524-4116fc6eea83
87
---
98
# Compiler Warning (level 1) C4804
109

11-
'operation' : unsafe use of type 'bool' in operation
10+
> 'operation' : unsafe use of type 'bool' in operation
11+
12+
## Remarks
1213

1314
This warning is for when you used a **`bool`** variable or value in an unexpected way. For example, C4804 is generated if you use operators such as the negative unary operator (**-**) or the complement operator (`~`). The compiler evaluates the expression.
1415

1516
## Example
1617

17-
The following sample generates C4804:
18+
The following example generates C4804:
1819

1920
```cpp
2021
// C4804.cpp

0 commit comments

Comments
 (0)