Skip to content

Commit a17e960

Browse files
authored
Merge pull request #5706 from Rageking8/structure-warning-references-in-range-c4000-c4040
Structure warning references in range [C4000, C4040]
2 parents b071ea5 + 0e7d9bf commit a17e960

28 files changed

+159
-109
lines changed

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

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

1010
> too many arguments for function-like macro invocation '*identifier*'
1111
12+
## Remarks
13+
1214
The number of actual parameters in the macro exceeds the number of formal parameters in the macro definition. The preprocessor collects the extra parameters but ignores them during macro expansion.
1315

1416
C4002 can occur when incorrectly using [variadic macros](../../preprocessor/variadic-macros.md).
1517

16-
The following sample generates C4002:
18+
## Example
19+
20+
The following example generates C4002:
1721

1822
```cpp
1923
// C4002.cpp

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

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

1010
> not enough arguments for function-like macro invocation '*identifier*'
1111
12+
## Remarks
13+
1214
The number of formal parameters in the macro definition exceeds the number of actual parameters in the macro. Macro expansion substitutes empty text for the missing parameters.
1315

14-
The following sample generates C4003:
16+
## Example
17+
18+
The following example generates C4003:
1519

1620
```cpp
1721
// C4003.cpp

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

Lines changed: 8 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) C4005"
32
title: "Compiler Warning (level 1) C4005"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4005"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4005"]
66
helpviewer_keywords: ["C4005"]
7-
ms.assetid: 7f2dc79a-9fcb-4d5b-be61-120d9cb487ad
87
---
98
# Compiler Warning (level 1) C4005
109

11-
'identifier' : macro redefinition
10+
> 'identifier' : macro redefinition
11+
12+
## Remarks
1213

1314
The macro identifier is defined twice. The compiler uses the second macro definition.
1415

@@ -24,7 +25,9 @@ The macro identifier is defined twice. The compiler uses the second macro defini
2425

2526
1. Use an [#undef](../../preprocessor/hash-undef-directive-c-cpp.md) directive before the second definition.
2627

27-
The following sample generates C4005:
28+
## Example
29+
30+
The following example generates C4005:
2831

2932
```cpp
3033
// C4005.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4006.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) C4006"
32
title: "Compiler Warning (level 1) C4006"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4006"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4006"]
66
helpviewer_keywords: ["C4006"]
7-
ms.assetid: f1a59819-0fd2-4361-8e3a-99e4b514b8e1
87
---
98
# Compiler Warning (level 1) C4006
109

11-
\#undef expected an identifier
10+
> #undef expected an identifier
11+
12+
## Remarks
13+
14+
The `#undef` directive did not specify an identifier to undefine. The directive is ignored. To resolve the warning, be sure to specify an identifier.
15+
16+
## Example
1217

13-
The `#undef` directive did not specify an identifier to undefine. The directive is ignored. To resolve the warning, be sure to specify an identifier. The following sample generates C4006:
18+
The following example generates C4006:
1419

1520
```cpp
1621
// C4006.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4010"
32
title: "Compiler Warning (level 1) C4010"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4010"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4010"]
66
helpviewer_keywords: ["C4010"]
7-
ms.assetid: d607a9ff-8f8f-45c0-b07b-3b2f439e5485
87
---
98
# Compiler Warning (level 1) C4010
109

11-
single-line comment contains line-continuation character
10+
> single-line comment contains line-continuation character
11+
12+
## Remarks
1213

1314
A single-line comment, which is introduced by //, contains a backslash (\\) that serves as a line-continuation character. The compiler considers the next line to be a continuation and treats it as a comment.
1415

1516
Some syntax-directed editors do not indicate the line following the continuation character as a comment. Ignore syntax coloring on any lines that cause this warning.
1617

17-
The following sample generates C4010:
18+
## Example
19+
20+
The following example generates C4010:
1821

1922
```cpp
2023
// C4010.cpp
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4015"
32
title: "Compiler Warning (level 1) C4015"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4015"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4015"]
66
helpviewer_keywords: ["C4015"]
7-
ms.assetid: 7242ab90-c869-482f-8152-46728575837e
87
---
98
# Compiler Warning (level 1) C4015
109

11-
'identifier' : type of bit field must be integral
10+
> 'identifier' : type of bit field must be integral
11+
12+
## Remarks
1213

1314
The bit field is not declared as an integer type. The compiler assumes the base type of the bit field to be unsigned. Bit fields must be declared as unsigned integer types.

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4020.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) C4020"
32
title: "Compiler Warning (level 1) C4020"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4020"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4020"]
66
helpviewer_keywords: ["C4020"]
7-
ms.assetid: 8c4cd6be-9371-4c8c-b0ff-a5ad367bbab0
87
---
98
# Compiler Warning (level 1) C4020
109

11-
'function' : too many actual parameters
10+
> 'function' : too many actual parameters
11+
12+
## Remarks
1213

1314
The number of actual parameters in a function call exceeds the number of formal parameters in the function prototype or definition. The compiler passes the extra actual parameters according to the calling convention of the function.
1415

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

1720
```c
1821
// C4020.c
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4022"
32
title: "Compiler Warning (level 1) C4022"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4022"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4022"]
66
helpviewer_keywords: ["C4022"]
7-
ms.assetid: 9586ca84-4b40-4602-91a4-2e2415b1ab63
87
---
98
# Compiler Warning (level 1) C4022
109

11-
'function' : pointer mismatch for actual parameter 'number'
10+
> 'function' : pointer mismatch for actual parameter 'number'
11+
12+
## Remarks
1213

1314
The pointer type of the actual parameter differs from the pointer type of the corresponding formal parameter. The actual parameter is passed without change.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4024"
32
title: "Compiler Warning (level 1) C4024"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4024"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4024"]
66
helpviewer_keywords: ["C4024"]
7-
ms.assetid: f6cb1b70-686a-4747-a01c-de673208209a
87
---
98
# Compiler Warning (level 1) C4024
109

11-
'function' : different types for formal and actual parameter 'number'
10+
> 'function' : different types for formal and actual parameter 'number'
11+
12+
## Remarks
1213

1314
Corresponding formal and actual parameters have different types. The compiler passes the actual parameter without change. The receiving function converts the parameter type to the type expected.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4025"
32
title: "Compiler Warning (level 1) C4025"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4025"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4025"]
66
helpviewer_keywords: ["C4025"]
7-
ms.assetid: c4f6a651-0641-4446-973e-8290065e49ad
87
---
98
# Compiler Warning (level 1) C4025
109

11-
'number' : based pointer passed to function with variable arguments: parameter number
10+
> 'number' : based pointer passed to function with variable arguments: parameter number
11+
12+
## Remarks
1213

1314
Passing a based pointer to a function with variable arguments causes the pointer to be normalized, with unpredictable results. Do not pass based pointers to functions with variable arguments.

0 commit comments

Comments
 (0)