Skip to content

Commit e9d9479

Browse files
authored
Add "Remarks" and "Example" headings for warning references in range [C4000, C4040]
1 parent 6300bc0 commit e9d9479

28 files changed

+73
-3
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ helpviewer_keywords: ["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

18+
## Examples
19+
1620
The following sample generates C4002:
1721

1822
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["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

16+
## Example
17+
1418
The following sample generates C4003:
1519

1620
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 7f2dc79a-9fcb-4d5b-be61-120d9cb487ad
1010

1111
> 'identifier' : macro redefinition
1212
13+
## Remarks
14+
1315
The macro identifier is defined twice. The compiler uses the second macro definition.
1416

1517
### To fix by checking the following possible causes
@@ -24,6 +26,8 @@ The macro identifier is defined twice. The compiler uses the second macro defini
2426

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

29+
## Example
30+
2731
The following sample generates C4005:
2832

2933
```cpp

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ ms.assetid: f1a59819-0fd2-4361-8e3a-99e4b514b8e1
1010

1111
> #undef expected an identifier
1212
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:
13+
## Remarks
14+
15+
The `#undef` directive did not specify an identifier to undefine. The directive is ignored. To resolve the warning, be sure to specify an identifier.
16+
17+
## Example
18+
19+
The following sample generates C4006:
1420

1521
```cpp
1622
// C4006.cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: d607a9ff-8f8f-45c0-b07b-3b2f439e5485
1010

1111
> single-line comment contains line-continuation character
1212
13+
## Remarks
14+
1315
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.
1416

1517
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.
1618

19+
## Example
20+
1721
The following sample generates C4010:
1822

1923
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 7242ab90-c869-482f-8152-46728575837e
1010

1111
> 'identifier' : type of bit field must be integral
1212
13+
## Remarks
14+
1315
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 8c4cd6be-9371-4c8c-b0ff-a5ad367bbab0
1010

1111
> 'function' : too many actual parameters
1212
13+
## Remarks
14+
1315
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.
1416

17+
## Example
18+
1519
The following sample generates C4020:
1620

1721
```c

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 9586ca84-4b40-4602-91a4-2e2415b1ab63
1010

1111
> 'function' : pointer mismatch for actual parameter 'number'
1212
13+
## Remarks
14+
1315
The pointer type of the actual parameter differs from the pointer type of the corresponding formal parameter. The actual parameter is passed without change.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: f6cb1b70-686a-4747-a01c-de673208209a
1010

1111
> 'function' : different types for formal and actual parameter 'number'
1212
13+
## Remarks
14+
1315
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.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: c4f6a651-0641-4446-973e-8290065e49ad
1010

1111
> 'number' : based pointer passed to function with variable arguments: parameter number
1212
13+
## Remarks
14+
1315
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)