11---
2- description : " Learn more about: Compiler Warning (Level 1) C4789"
32title : " Compiler Warning (Level 1) C4789"
3+ description : " Learn more about: Compiler Warning (Level 1) C4789"
44ms.date : 08/30/2022
55f1_keywords : ["C4789"]
66helpviewer_keywords : ["C4789"]
7- ms.assetid : 5800c301-5afb-4af0-85c1-ceb54d775234
87---
98# Compiler Warning (Level 1) C4789
109
@@ -19,9 +18,7 @@ ms.assetid: 5800c301-5afb-4af0-85c1-ceb54d775234
1918The warning occurs if the copy uses the intrinsic form of one of these CRT functions:
2019
2120- [ ` strcpy ` ] ( ../../c-runtime-library/reference/strcpy-wcscpy-mbscpy.md )
22-
2321- [ ` memset ` ] ( ../../c-runtime-library/reference/memset-wmemset.md )
24-
2522- [ ` memcpy ` ] ( ../../c-runtime-library/reference/memcpy-wmemcpy.md ) , [ ` wmemcpy ` ] ( ../../c-runtime-library/reference/memcpy-wmemcpy.md )
2623
2724The warning also appears when you cast a parameter to a larger data type, and then make a copy assignment from an lvalue reference.
@@ -31,7 +28,7 @@ Visual C++ might generate this warning for a code path that never executes. You
3128``` cpp
3229#pragma warning( push )
3330#pragma warning( disable : 4789 )
34- // unused code that generates compiler warning C4789`
31+ // unused code that generates compiler warning C4789
3532#pragma warning( pop )
3633```
3734
@@ -41,7 +38,7 @@ The [`/sdl` (Enable Additional Security Checks)](../../build/reference/sdl-enabl
4138
4239## Examples
4340
44- The following sample generates C4789.
41+ The following sample generates C4789:
4542
4643``` cpp
4744// C4789.cpp
@@ -63,7 +60,7 @@ int main()
6360}
6461```
6562
66- The following sample also generates C4789.
63+ The following sample also generates C4789:
6764
6865``` cpp
6966// C4789b.cpp
0 commit comments