Skip to content

Commit 4f09846

Browse files
authored
Merge pull request #5712 from Rageking8/structure-warning-references-in-range-c4201-c4230
Structure warning references in range [C4201, C4230]
2 parents caca6d7 + e04e6bd commit 4f09846

24 files changed

+163
-87
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4215"
32
title: "Compiler Warning (level 1) C4215"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4215"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4215"]
66
helpviewer_keywords: ["C4215"]
7-
ms.assetid: f2aab64d-1bab-4f75-95ee-89e1263047b1
87
---
98
# Compiler Warning (level 1) C4215
109

11-
nonstandard extension used : long float
10+
> nonstandard extension used : long float
11+
12+
## Remarks
1213

1314
The default Microsoft extensions (/Ze) treat **long float** as **`double`**. ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) does not. Use **`double`** to maintain compatibility.
1415

15-
The following sample generates C4215:
16+
## Example
17+
18+
The following example generates C4215:
1619

1720
```cpp
1821
// C4215.cpp

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4216"
32
title: "Compiler Warning (level 1) C4216"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4216"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4216"]
66
helpviewer_keywords: ["C4216"]
7-
ms.assetid: 211079dc-59d0-42a7-801c-2ddab21d7232
87
---
98
# Compiler Warning (level 1) C4216
109

11-
nonstandard extension used : float long
10+
> nonstandard extension used : float long
11+
12+
## Remarks
13+
14+
The default Microsoft extensions (/Ze) treat **float long** as **`double`**. ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) does not. Use **`double`** to maintain compatibility.
15+
16+
## Example
1217

13-
The default Microsoft extensions (/Ze) treat **float long** as **`double`**. ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) does not. Use **`double`** to maintain compatibility. The following sample generates C4216:
18+
The following example generates C4216:
1419

1520
```cpp
1621
// C4216.cpp

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

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

1010
> nonstandard extension used: must specify at least a storage class or a type
1111
12+
## Remarks
13+
1214
With the default Microsoft extensions (`/Ze`), you can declare a variable without specifying a type or storage class. The default type is **`int`**.
1315

1416
## Example
1517

18+
The following example generates C4218:
19+
1620
```cpp
1721
// C4218.c
1822
// compile with: /W4

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4224"
32
title: "Compiler Warning (level 1) C4224"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4224"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4224"]
66
helpviewer_keywords: ["C4224"]
7-
ms.assetid: 1531cae0-5040-49fd-b149-005bb5085391
87
---
98
# Compiler Warning (level 1) C4224
109

11-
nonstandard extension used : formal parameter 'identifier' was previously defined as a type
10+
> nonstandard extension used : formal parameter 'identifier' was previously defined as a type
11+
12+
## Remarks
1213

1314
The identifier was previously used as a **`typedef`**. This causes a warning under ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)).
1415

1516
## Example
1617

18+
The following example generates C4224:
19+
1720
```cpp
1821
// C4224.cpp
1922
// compile with: /Za /W1 /LD
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4226"
32
title: "Compiler Warning (level 1) C4226"
4-
ms.date: "10/25/2017"
3+
description: "Learn more about: Compiler Warning (level 1) C4226"
4+
ms.date: 10/25/2017
55
f1_keywords: ["C4226"]
66
helpviewer_keywords: ["C4226"]
7-
ms.assetid: 69d6bbde-1300-4e48-8a9c-3648c80ab441
87
---
98
# Compiler Warning (level 1) C4226
109

1110
> nonstandard extension used : '*keyword*' is an obsolete keyword
1211
12+
## Remarks
13+
1314
The current version of Visual C++ does not use this keyword.
1415

1516
This warning is automatically promoted to an error.

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4227"
32
title: "Compiler Warning (level 1) C4227"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4227"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4227"]
66
helpviewer_keywords: ["C4227"]
7-
ms.assetid: 78f98374-c00b-4000-aefa-1b1c67b4666b
87
---
98
# Compiler Warning (level 1) C4227
109

11-
anachronism used : qualifiers on reference are ignored
10+
> anachronism used : qualifiers on reference are ignored
11+
12+
## Remarks
1213

1314
Using qualifiers like **`const`** or **`volatile`** with C++ references is an outdated practice.
1415

1516
## Example
1617

18+
The following example generates C4227:
19+
1720
```cpp
1821
// C4227.cpp
1922
// compile with: /W1 /c

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4228"
32
title: "Compiler Warning (level 1) C4228"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4228"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4228"]
66
helpviewer_keywords: ["C4228"]
7-
ms.assetid: 9301d660-d601-464e-83f5-7ed844a3c6dc
87
---
98
# Compiler Warning (level 1) C4228
109

11-
nonstandard extension used : qualifiers after comma in declarator list are ignored
10+
> nonstandard extension used : qualifiers after comma in declarator list are ignored
11+
12+
## Remarks
1213

1314
Use of qualifiers like **`const`** or **`volatile`** after a comma when declaring variables is a Microsoft extension ([/Ze](../../build/reference/za-ze-disable-language-extensions.md)).
1415

1516
## Example
1617

18+
The following example generates C4228:
19+
1720
```cpp
1821
// C4228.cpp
1922
// compile with: /W1

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

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

1010
> anachronism used: modifiers on data are ignored
1111
12+
## Remarks
13+
1214
Using a Microsoft modifier such as **`__cdecl`** on a data declaration is an outdated practice.
1315

1416
## Example
1517

18+
The following example generates C4229:
19+
1620
```cpp
1721
// C4229.cpp
1822
// compile with: /W1 /LD

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4230"
32
title: "Compiler Warning (level 1) C4230"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4230"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4230"]
66
helpviewer_keywords: ["C4230"]
7-
ms.assetid: a4be8729-74b6-44df-a5ea-e3f45aad0f8f
87
---
98
# Compiler Warning (level 1) C4230
109

11-
anachronism used : modifiers/qualifiers interspersed; qualifier ignored
10+
> anachronism used : modifiers/qualifiers interspersed; qualifier ignored
11+
12+
## Remarks
1213

1314
Using a qualifier before a Microsoft modifier such as **`__cdecl`** is an outdated practice.
1415

1516
## Example
1617

18+
The following example generates C4230:
19+
1720
```cpp
1821
// C4230.cpp
1922
// compile with: /W1 /LD

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4201"
32
title: "Compiler Warning (level 4) C4201"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 4) C4201"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4201"]
66
helpviewer_keywords: ["C4201"]
7-
ms.assetid: 6156f508-9393-4d77-9e73-1ec3e1c32d0d
87
---
98
# Compiler Warning (level 4) C4201
109

11-
nonstandard extension used : nameless struct/union
10+
> nonstandard extension used : nameless struct/union
11+
12+
## Remarks
1213

1314
Under Microsoft extensions (/Ze), you can specify a structure without a declarator as members of another structure or union. These structures generate an error under ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)).
1415

1516
## Example
1617

18+
The following example generates C4201:
19+
1720
```cpp
1821
// C4201.cpp
1922
// compile with: /W4

0 commit comments

Comments
 (0)