Skip to content

Commit cf0fb9b

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2121, C2140]
1 parent fb09af6 commit cf0fb9b

15 files changed

+46
-2
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2121.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: e04f32da-3736-4df3-8a1c-d687afcecf5c
1010

1111
> '#' : invalid character : possibly the result of a macro expansion
1212
13+
## Remarks
14+
1315
An invalid # character may have been inserted by an incorrect macro that uses the token-pasting operator (##) instead of the stringizing operator (#).

docs/error-messages/compiler-errors-1/compiler-error-c2122.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: bc060002-cd38-481b-a144-65af035ce851
1010

1111
> 'identifier' : prototype parameter in name list illegal
1212
13+
## Remarks
14+
1315
The parameter is not a legal type. ANSI C does not support user-defined types.

docs/error-messages/compiler-errors-1/compiler-error-c2124.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 93392aaa-5582-4d68-8cc5-bd9c62a0ae7e
1010

1111
> divide or mod by zero
1212
13+
## Remarks
14+
1315
A constant expression has a zero denominator. To resolve the error, do not divide by zero.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2128.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2128"]
99

1010
> 'function' : alloc_text/same_seg applicable only to functions with C linkage
1111
12+
## Remarks
13+
1214
`#pragma alloc_text` can only be used with functions declared to have C linkage.
1315

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

1620
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2129.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 21a8223e-1d22-4baa-9ca1-922b7f751dd0
1010

1111
> static function 'function' declared but not defined
1212
13+
## Remarks
14+
1315
A forward reference is made to a **`static`** function that is never defined.
1416

1517
A **`static`** function must be defined within file scope. If the function is defined in another file, it must be declared **`extern`**.
1618

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

1923
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2130.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: c6fd5a7e-8f28-4f67-99d1-95a13b0dff90
1010

1111
> #line expected a string containing the filename, found 'token'
1212
13+
## Remarks
14+
1315
The optional file name token following [#line](../../preprocessor/hash-line-directive-c-cpp.md) `linenumber` must be a string.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2131.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["C2131"]
99

1010
> expression did not evaluate to a constant
1111
12+
## Remarks
13+
1214
An expression declared as **`const`** or **`constexpr`** didn't evaluate to a constant at compile time. The compiler must be able to determine the value of the expression at the point it's used.
1315

1416
## Example

docs/error-messages/compiler-errors-1/compiler-error-c2132.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 32902472-49d1-4513-888f-b52d336839d5
1010

1111
> syntax error : unexpected identifier
1212
13+
## Remarks
14+
1315
An identifier appears in an unsupported context.

docs/error-messages/compiler-errors-1/compiler-error-c2133.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 8942f9e8-9818-468f-97db-09dbd124fcae
1010

1111
> 'identifier' : unknown size
1212
13+
## Remarks
14+
1315
An unsized array is declared as a member of a class, structure, union, or enumeration. The /Za (ANSI C) option does not allow unsized member arrays.
1416

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

1721
```cpp

docs/error-messages/compiler-errors-1/compiler-error-c2134.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["C2134"]
99

1010
> 'function' : call does not result in a constant expression
1111
12+
## Remarks
13+
1214
A function declared as constexpr can only call other functions declared as constexpr.
1315

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

1620
```cpp

0 commit comments

Comments
 (0)