Skip to content

Commit 5ef892c

Browse files
Merge pull request #5026 from MicrosoftDocs/main638494903117055857sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents d685ebd + 24602ab commit 5ef892c

18 files changed

+128
-145
lines changed

docs/error-messages/compiler-warnings/compiler-warning-c4355.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
2-
description: "Learn more about: Compiler Warning C4355"
3-
title: "Compiler Warning C4355"
2+
description: "Learn more about: Compiler Warning (level 1 and level 4, off) C4355"
3+
title: "Compiler Warning (level 1 and level 4, off) C4355"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4355"]
66
helpviewer_keywords: ["C4355"]
7-
ms.assetid: b819ecab-8a07-42d7-8fa4-1180d51626c0
87
---
9-
# Compiler Warning C4355
8+
# Compiler Warning (level 1 and level 4, off) C4355
109

11-
'this' : used in base member initializer list
10+
> '`this`': used in base member initializer list
1211
13-
The **`this`** pointer is valid only within nonstatic member functions. It cannot be used in the initializer list for a base class.
12+
The `this` pointer is valid only within nonstatic member functions. It can't be used in the initializer list for a base class.
1413

15-
The base-class constructors and class member constructors are called before **`this`** constructor. In effect, you've passed a pointer to an unconstructed object to another constructor. If those other constructors access any members or call member functions on this, the result will be undefined. You should not use the **`this`** pointer until all construction has completed.
14+
The base-class constructors and class member constructors are called before `this` constructor. This pattern is the same as passing a pointer to an unconstructed object to another constructor. If those other constructors access any members or call member functions on `this`, the result is undefined. You shouldn't use the `this` pointer until all construction is complete.
1615

17-
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
16+
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1817

1918
The following sample generates C4355:
2019

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4218"
3-
title: "Compiler Warning (level 1) C4218"
2+
description: "Learn more about: Compiler Warning (level 4) C4218"
3+
title: "Compiler Warning (level 4) C4218"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4218"]
66
helpviewer_keywords: ["C4218"]
7-
ms.assetid: d6c3cd90-4518-49e9-ae86-4ba9e2761d98
87
---
9-
# Compiler Warning (level 1) C4218
8+
# Compiler Warning (level 4) C4218
109

11-
nonstandard extension used : must specify at least a storage class or a type
10+
> nonstandard extension used: must specify at least a storage class or a type
1211
13-
With the default Microsoft extensions (/Ze), you can declare a variable without specifying a type or storage class. The default type is **`int`**.
12+
With the default Microsoft extensions (`/Ze`), you can declare a variable without specifying a type or storage class. The default type is **`int`**.
1413

1514
## Example
1615

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4229"
3-
title: "Compiler Warning (level 1) C4229"
2+
description: "Learn more about: Compiler Warning (level 1, Error) C4229"
3+
title: "Compiler Warning (level 1, Error) C4229"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4229"]
66
helpviewer_keywords: ["C4229"]
7-
ms.assetid: aadfc83b-1e5f-4229-bd0a-9c10a5d13182
87
---
9-
# Compiler Warning (level 1) C4229
8+
# Compiler Warning (level 1, Error) C4229
109

11-
anachronism used : modifiers on data are ignored
10+
> anachronism used: modifiers on data are ignored
1211
1312
Using a Microsoft modifier such as **`__cdecl`** on a data declaration is an outdated practice.
1413

@@ -17,5 +16,5 @@ Using a Microsoft modifier such as **`__cdecl`** on a data declaration is an out
1716
```cpp
1817
// C4229.cpp
1918
// compile with: /W1 /LD
20-
int __cdecl counter; // C4229 cdecl ignored
19+
int __cdecl counter; // C4229
2120
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4251"
3-
title: "Compiler Warning (level 1) C4251"
2+
description: "Learn more about: Compiler Warning (level 2) C4251"
3+
title: "Compiler Warning (level 2) C4251"
44
ms.date: 12/01/2023
55
f1_keywords: ["C4251"]
66
helpviewer_keywords: ["C4251"]
77
---
8-
# Compiler Warning (level 1) C4251
8+
# Compiler Warning (level 2) C4251
99

1010
> '*type*' : class '*type1*' needs to have dll-interface to be used by clients of class '*type2*'
1111

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4305"
3-
title: "Compiler Warning (level 1) C4305"
2+
description: "Learn more about: Compiler Warning (level 1 and level 2 and level 4) C4305"
3+
title: "Compiler Warning (level 1 and level 2 and level 4) C4305"
44
ms.date: "01/17/2018"
55
f1_keywords: ["C4305"]
66
helpviewer_keywords: ["C4305"]
77
---
88
# Compiler Warning (level 1) C4305
99

10-
> '*context*' : truncation from '*type1*' to '*type2*'
10+
> '*conversion*': truncation from '*type1*' to '*type2*'
1111
1212
## Remarks
1313

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ title: "Compiler Warning (level 1) C4329"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4329"]
66
helpviewer_keywords: ["C4329"]
7-
ms.assetid: 4316f51a-2c56-4b3f-831e-65d24b83b65c
87
---
98
# Compiler Warning (level 1) C4329
109

11-
__declspec(align()) is ignored on enum
10+
> alignment specifier is ignored on enum
1211
13-
Use of the [align](../../cpp/align-cpp.md) keyword of the [__declspec](../../cpp/declspec.md) modifier is not allowed on an **`enum`**. The following sample generates C4329:
12+
Use of the alignment specifiers on `enum` isn't allowed. This pattern includes the use of the [`align`](../../cpp/align-cpp.md) [`__declspec`](../../cpp/declspec.md) modifier. The following sample generates C4329:
1413

1514
```cpp
1615
// C4329.cpp

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ title: "Compiler Warning (level 1) C4384"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4384"]
66
helpviewer_keywords: ["C4384"]
7-
ms.assetid: fafa8eb2-cbfc-4edb-8b0f-511ff5d37ac0
87
---
98
# Compiler Warning (level 1) C4384
109

11-
\#pragma 'make_public' should only be used at global scope
10+
> `#pragma` '*pragma_name*' should only be used at global scope
1211
13-
The [make_public](../../preprocessor/make-public.md) pragma was applied incorrectly.
12+
A `pragma` directive that must be applied at a global scope, was found in a different scope.
13+
14+
The warning applies to the following `pragma` directives:
15+
* [`detect_mismatch`](../../preprocessor/detect-mismatch.md)
16+
* `extern_absolute`
17+
* [`make_public`](../../preprocessor/make-public.md)
1418

1519
## Example
1620

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4265.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ helpviewer_keywords: ["C4265"]
77
---
88
# Compiler Warning (level 3, off) C4265
99

10-
> 'class' : class has virtual functions, but destructor is not virtual
10+
> '*classname*': class has virtual functions, but its non-trivial destructor is not virtual; instances of this class may not be destructed correctly
1111
1212
When a class has virtual functions but a nonvirtual destructor, objects of the type might not be destroyed properly when the class is destroyed through a base class pointer.
1313

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 3) C4306"
3-
title: "Compiler Warning (level 3) C4306"
2+
description: "Learn more about: Compiler Warning (level 4) C4306"
3+
title: "Compiler Warning (level 4) C4306"
44
ms.date: "08/27/2018"
55
f1_keywords: ["C4306"]
66
helpviewer_keywords: ["C4306"]
7-
ms.assetid: 5b2192d7-402d-4b6d-8619-08105e7dcac7
87
---
9-
# Compiler Warning (level 3) C4306
8+
# Compiler Warning (level 4) C4306
109

11-
> '*identifier*' : conversion from '*type1*' to '*type2*' of greater size
10+
> '*conversion*': conversion from '*type1*' to '*type2*' of greater size
1211
13-
The identifier is type cast to a larger pointer. The unfilled high bits of the new type will be zero-filled.
12+
The identifier is type cast to a larger pointer. The unfilled high bits of the new type are zero-filled.
1413

1514
This warning may indicate an unwanted conversion. The resulting pointer may not be valid.

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4310.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
description: "Learn more about: Compiler Warning (level 4) C4310"
3-
title: "Compiler Warning (level 3) C4310"
3+
title: "Compiler Warning (level 4) C4310"
44
ms.date: 10/17/2023
55
f1_keywords: ["C4310"]
66
helpviewer_keywords: ["C4310"]
77
---
88
# Compiler Warning (level 4) C4310
99

10-
cast truncates constant value
10+
> cast truncates constant value
1111
1212
A constant value is cast to a smaller type. The compiler performs the cast, which truncates data. The following sample generates C4310:
1313

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4233"
3-
title: "Compiler Warning (level 4) C4233"
2+
description: "Learn more about: Compiler Warning (level 1, Error) C4233"
3+
title: "Compiler Warning (level 1, Error) C4233"
44
ms.date: "10/25/2017"
55
f1_keywords: ["C4233"]
66
helpviewer_keywords: ["C4233"]
7-
ms.assetid: 9aa51fc6-8ef3-43b5-bafb-c9333cf60de3
87
---
9-
# Compiler Warning (level 4) C4233
8+
# Compiler Warning (level 1, Error) C4233
109

11-
> nonstandard extension used : '*keyword*' keyword only supported in C++, not C
10+
> nonstandard extension used: '*keyword*' keyword only supported in C++, not C
1211
1312
The compiler compiled your source code as C rather than C++, and you used a keyword that is only valid in C++. The compiler compiles your source file as C if the extension of the source file is .c or you use [/Tc](../../build/reference/tc-tp-tc-tp-specify-source-file-type.md).
1413

15-
This warning is automatically promoted to an error. If you wish to modify this behavior, use [#pragma warning](../../preprocessor/warning.md). For example, to make C4233 into a level 4 warning issue, add this line to your source code file:
16-
17-
```cpp
18-
#pragma warning(4:4233)
19-
```
14+
This warning is always issued as an error. Use the [warning](../../preprocessor/warning.md) pragma to disable.
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4235"
3-
title: "Compiler Warning (level 4) C4235"
2+
description: "Learn more about: Compiler Warning (level 1, Error) C4235"
3+
title: "Compiler Warning (level 1, Error) C4235"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4235"]
66
helpviewer_keywords: ["C4235"]
7-
ms.assetid: d4214799-d62c-4674-b4e2-9e201c303303
87
---
9-
# Compiler Warning (level 4) C4235
8+
# Compiler Warning (level 1, Error) C4235
109

11-
nonstandard extension used : 'keyword' keyword not supported on this architecture
10+
> nonstandard extension used: '*keyword*' keyword not supported on this architecture
1211
13-
The compiler does not support the keyword you used.
12+
The compiler doesn't support the keyword you used on the architecture your build is targeting.
1413

15-
This warning is automatically promoted to an error. If you wish to modify this behavior, use [#pragma warning](../../preprocessor/warning.md). For example, to make C4235 into a level 2 warning, use the following line of code
16-
17-
```cpp
18-
#pragma warning(2:4235)
19-
```
20-
21-
in your source code file.
14+
This warning is always issued as an error. Use the [warning](../../preprocessor/warning.md) pragma to disable.

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4242.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4242"
3-
title: "Compiler Warning (level 4) C4242"
2+
description: "Learn more about: Compiler Warning (level 3, off) C4242"
3+
title: "Compiler Warning (level 3, off) C4242"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4242"]
66
helpviewer_keywords: ["C4242"]
7-
ms.assetid: 8df742e1-fbf1-42f3-8e93-c0e1c222dc7e
87
---
9-
# Compiler Warning (level 4) C4242
8+
# Compiler Warning (level 3, off) C4242
109

11-
'identifier' : conversion from 'type1' to 'type2', possible loss of data
10+
> '*identifier*': conversion from '*type1*' to '*type2*', possible loss of data
1211
1312
The types are different. Type conversion may result in loss of data. The compiler makes the type conversion.
1413

15-
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
14+
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1615

17-
For additional information on C4242, see [Common Compiler Errors](/windows/win32/WinProg64/common-compiler-errors).
16+
For more information on C4242, see [Common Compiler Errors](/windows/win32/WinProg64/common-compiler-errors).
1817

1918
The following sample generates C4242:
2019

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4254.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4254"
3-
title: "Compiler Warning (level 4) C4254"
2+
description: "Learn more about: Compiler Warning (level 4, off) C4254"
3+
title: "Compiler Warning (level 4, off) C4254"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4254"]
66
helpviewer_keywords: ["C4254"]
77
---
88
# Compiler Warning (level 4) C4254
99

10-
'operator' : conversion from 'type1' to 'type2', possible loss of data
10+
> '*operator*': conversion from '*type1*':'*field_bits*' to '*type2*':'*field_bits*', possible loss of data
1111
1212
A larger bit field was assigned to a smaller bit field. There could be a loss of data.
1313

14-
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
14+
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1515

1616
The following sample generates C4254:
1717

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4324.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ title: "Compiler Warning (level 4) C4324"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4324"]
66
helpviewer_keywords: ["C4324"]
7-
ms.assetid: 420fa929-d9c0-40b4-8808-2d8ad3ca8090
87
---
98
# Compiler Warning (level 4) C4324
109

11-
'struct_name' : structure was padded due to __declspec(align())
10+
> '*structname*': structure was padded due to alignment specifier
1211
13-
Padding was added at the end of a structure because you specified a [__declspec(align)](../../cpp/align-cpp.md) value.
12+
Padding was added at the end of a structure because you specified an alignment specifier, such as [__declspec(align)](../../cpp/align-cpp.md).
1413

1514
For example, the following code generates C4324:
1615

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
description: "Learn more about: Compiler Warning (levels 1 and 4) C4223"
3-
title: "Compiler Warning (levels 1 and 4) C4223"
2+
description: "Learn more about: Compiler Warning (level 1 and level 4) C4223"
3+
title: "Compiler Warning (level 1 and level 4) C4223"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4223"]
66
helpviewer_keywords: ["C4223"]
77
ms.assetid: 6fc44336-0250-4432-928b-fc5dbe7b7c1c
88
---
9-
# Compiler Warning (levels 1 and 4) C4223
9+
# Compiler Warning (level 1 and level 4) C4223
1010

11-
nonstandard extension used : non-lvalue array converted to pointer
11+
> nonstandard extension used: non-lvalue array converted to pointer
1212
13-
In standard C, you cannot convert a non-lvalue array to a pointer. With the default Microsoft extensions ([/Ze](../../build/reference/za-ze-disable-language-extensions.md)), you can.
13+
In standard C, you can't convert a nonlvalue array to a pointer. With the default Microsoft extensions ([`/Ze`](../../build/reference/za-ze-disable-language-extensions.md)), you can.
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
---
2-
description: "Learn more about: Compiler Warning (levels 2 and 4) C4200"
3-
title: "Compiler Warning (levels 2 and 4) C4200"
2+
description: "Learn more about: Compiler Warning (level 2 and level 4) C4200"
3+
title: "Compiler Warning (level 2 and level 4) C4200"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4200"]
66
helpviewer_keywords: ["C4200"]
7-
ms.assetid: e44d6073-937f-42b7-acc1-65e802b475c6
87
---
9-
# Compiler Warning (levels 2 and 4) C4200
8+
# Compiler Warning (level 2 and level 4) C4200
109

11-
nonstandard extension used : zero-sized array in struct/union
10+
> nonstandard extension used: zero-sized array in struct/union
1211
13-
Indicates that a structure or union contains an array that has zero size.
14-
15-
Declaration of a zero-sized array is a Microsoft extension. This causes a Level-2 warning when a C++ file is compiled and a Level-4 warning when a C file is compiled. C++ compilation also gives this warning: "Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array." This example generates warning C4200:
12+
C++ only:
13+
> This member will be ignored by a defaulted constructor or copy/move assignment operator
14+
15+
This warning indicates that a structure or union contains an array that has zero size. Declaration of a zero-sized array is a nonstandard compiler extension. This causes a Level-2 warning when a C++ file is compiled and a Level-4 warning when a C file is compiled. This example generates warning C4200:
1616

1717
```cpp
1818
// C4200.cpp
1919
// compile by using: cl /W4 c4200.cpp
2020
struct A {
21+
int len;
2122
int a[0]; // C4200
2223
};
23-
int main() {
24-
}
2524
```
2625
27-
This non-standard extension is often used to interface code with external data structures that have a variable length. If this scenario applies to your code, you can disable the warning:
26+
This nonstandard extension is often used to interface code with external data structures that have a variable length. If this scenario applies to your code, you can disable the warning:
2827
2928
## Example
3029
@@ -33,8 +32,7 @@ This non-standard extension is often used to interface code with external data s
3332
// compile by using: cl /W4 c4200a.cpp
3433
#pragma warning(disable : 4200)
3534
struct A {
35+
int len;
3636
int a[0];
3737
};
38-
int main() {
39-
}
4038
```

0 commit comments

Comments
 (0)