Skip to content

Commit 91296d7

Browse files
authored
Add "Remarks" and "Example" headings for warning references in range [C4121, C4160]
1 parent 9d6cd2e commit 91296d7

24 files changed

+65
-5
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 9a83eb0d-8708-42f7-988a-b0b6f2f646a0
1010

1111
> 'function' : alloc_text applicable only to functions with C linkage
1212
13+
## Remarks
14+
1315
The **alloc_text** pragma applies only to functions declared with **extern c**. It cannot be used with external C++ functions.
1416

1517
The pragma is ignored.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c08c3a65-9584-47a1-a147-44f00c4b230e
1010

1111
> __fastcall with stack checking is inefficient
1212
13+
## Remarks
14+
1315
The **`__fastcall`** keyword was used with stack checking enabled.
1416

1517
The **`__fastcall`** convention generates faster code, but stack checking causes slower code. When using **`__fastcall`**, turn off stack checking with the **check_stack** pragma or /Gs.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ ms.assetid: a4190c64-4bfb-48fd-8e98-52720bc0d878
1010

1111
> 'character' : unrecognized character escape sequence
1212
13+
## Remarks
14+
1315
The `character` following a backslash (\\) in a character or string constant is not recognized as a valid escape sequence. The backslash is ignored and not printed. The character following the backslash is printed.
1416

1517
To print a single backslash, specify a double backslash (\\\\).
1618

1719
The C++ standard, in section 2.13.2 discusses escape sequences.
1820

21+
## Example
22+
1923
The following sample generates C4129:
2024

2125
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 65ebf929-bba0-4237-923b-c1b66adfe17d
1010

1111
> '*/' found outside of comment
1212
13+
## Remarks
14+
1315
The closing-comment delimiter is not preceded by an opening-comment delimiter. The compiler assumes a space between the asterisk (<strong>\*</strong>) and the forward slash (/).
1416

1517
## Example

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 1fdfc3dc-60a2-4f00-b133-20e400f9b7a6
1010

1111
> benign redefinition of type
1212
13+
## Remarks
14+
1315
A type is redefined in a manner that has no effect on the generated code.
1416

1517
To fix by checking the following possible causes:
@@ -18,6 +20,8 @@ To fix by checking the following possible causes:
1820

1921
- A type defined with the **`typedef`** command is redefined using different syntax.
2022

23+
## Example
24+
2125
The following sample generates C4142:
2226

2327
```c

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: ef0bd19f-d169-4034-8710-b22971bd642d
1010

1111
> pragma 'same_seg' not supported; use __based allocation
1212
13+
## Remarks
14+
1315
The **#pragma same_seg** is no longer supported. Use the [__based](../../cpp/based-pointers-cpp.md) keyword instead.

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ ms.assetid: a37b445d-dbc6-43b4-8d95-ffd0e4225464
1010

1111
> 'expression' : relational expression as switch expression
1212
13-
The specified relational expression was used as the control expression of a [switch](../../cpp/switch-statement-cpp.md) statement. The associated case statements will be offered Boolean values. The following sample generates C4144:
13+
## Remarks
14+
15+
The specified relational expression was used as the control expression of a [switch](../../cpp/switch-statement-cpp.md) statement. The associated case statements will be offered Boolean values.
16+
17+
## Example
18+
19+
The following sample generates C4144:
1420

1521
```cpp
1622
// C4144.cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 0440777a-cca2-4159-aff5-e67a254ad64a
1010

1111
> 'expression1' : relational expression as switch expression; possible confusion with 'expression2'
1212
13+
## Remarks
14+
1315
A **`switch`** statement uses a relational expression as its control expression, which results in a Boolean value for the **`case`** statements. Did you mean *expression2*?
1416

1517
## Example

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 37a15754-9dba-470b-adda-c4b888064b3e
1010

1111
> function/data pointer conversion in expression
1212
13+
## Remarks
14+
1315
A function pointer is converted to or from a data pointer. This conversion is allowed under Microsoft extensions (/Ze) but not under ANSI C.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 4511afeb-e893-4cc6-83b6-4c7a0477f76b
1010

1111
> deletion of an array expression; conversion to pointer supplied
1212
13+
## Remarks
14+
1315
You cannot use **`delete`** on an array, so the compiler converts the array to a pointer.
1416

1517
## Example

0 commit comments

Comments
 (0)