Skip to content

Commit 31fc379

Browse files
Merge pull request #5541 from Rageking8/structure-error-references-in-range-c2121-c2140
Structure error references in range [C2121, C2140]
2 parents f87d1fa + 51f00f1 commit 31fc379

15 files changed

+96
-63
lines changed
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 Error C2121"
32
title: "Compiler Error C2121"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2121"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2121"]
66
helpviewer_keywords: ["C2121"]
7-
ms.assetid: e04f32da-3736-4df3-8a1c-d687afcecf5c
87
---
98
# Compiler Error C2121
109

11-
'#' : invalid character : possibly the result of a macro expansion
10+
> '#' : invalid character : possibly the result of a macro expansion
11+
12+
## Remarks
1213

1314
An invalid # character may have been inserted by an incorrect macro that uses the token-pasting operator (##) instead of the stringizing operator (#).
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 Error C2122"
32
title: "Compiler Error C2122"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2122"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2122"]
66
helpviewer_keywords: ["C2122"]
7-
ms.assetid: bc060002-cd38-481b-a144-65af035ce851
87
---
98
# Compiler Error C2122
109

11-
'identifier' : prototype parameter in name list illegal
10+
> 'identifier' : prototype parameter in name list illegal
11+
12+
## Remarks
1213

1314
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: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2124"
32
title: "Compiler Error C2124"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2124"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2124"]
66
helpviewer_keywords: ["C2124"]
7-
ms.assetid: 93392aaa-5582-4d68-8cc5-bd9c62a0ae7e
87
---
98
# Compiler Error C2124
109

11-
divide or mod by zero
10+
> divide or mod by zero
11+
12+
## Remarks
1213

1314
A constant expression has a zero denominator. To resolve the error, do not divide by zero.
1415

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

1720
```cpp
1821
// C2124.cpp

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

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

10-
'function' : alloc_text/same_seg applicable only to functions with C linkage
10+
> 'function' : alloc_text/same_seg applicable only to functions with C linkage
11+
12+
## Remarks
1113

1214
`#pragma alloc_text` can only be used with functions declared to have C linkage.
1315

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

1620
```cpp
1721
// C2128.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2129.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 Error C2129"
32
title: "Compiler Error C2129"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2129"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2129"]
66
helpviewer_keywords: ["C2129"]
7-
ms.assetid: 21a8223e-1d22-4baa-9ca1-922b7f751dd0
87
---
98
# Compiler Error C2129
109

11-
static function 'function' declared but not defined
10+
> static function 'function' declared but not defined
11+
12+
## Remarks
1213

1314
A forward reference is made to a **`static`** function that is never defined.
1415

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

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

1922
```cpp
2023
// C2129.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2130.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 Error C2130"
32
title: "Compiler Error C2130"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2130"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2130"]
66
helpviewer_keywords: ["C2130"]
7-
ms.assetid: c6fd5a7e-8f28-4f67-99d1-95a13b0dff90
87
---
98
# Compiler Error C2130
109

11-
\#line expected a string containing the filename, found 'token'
10+
> #line expected a string containing the filename, found 'token'
11+
12+
## Remarks
1213

1314
The optional file name token following [#line](../../preprocessor/hash-line-directive-c-cpp.md) `linenumber` must be a string.
1415

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

1720
```cpp
1821
// C2130.cpp

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2131"
32
title: "Compiler Error C2131"
4-
ms.date: "02/28/2019"
3+
description: "Learn more about: Compiler Error C2131"
4+
ms.date: 02/28/2019
55
f1_keywords: ["C2131"]
66
helpviewer_keywords: ["C2131"]
77
---
88
# Compiler Error 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
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 Error C2132"
32
title: "Compiler Error C2132"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2132"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2132"]
66
helpviewer_keywords: ["C2132"]
7-
ms.assetid: 32902472-49d1-4513-888f-b52d336839d5
87
---
98
# Compiler Error C2132
109

11-
syntax error : unexpected identifier
10+
> syntax error : unexpected identifier
11+
12+
## Remarks
1213

1314
An identifier appears in an unsupported context.

docs/error-messages/compiler-errors-1/compiler-error-c2133.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 Error C2133"
32
title: "Compiler Error C2133"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2133"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2133"]
66
helpviewer_keywords: ["C2133"]
7-
ms.assetid: 8942f9e8-9818-468f-97db-09dbd124fcae
87
---
98
# Compiler Error C2133
109

11-
'identifier' : unknown size
10+
> 'identifier' : unknown size
11+
12+
## Remarks
1213

1314
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.
1415

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

1720
```cpp
1821
// C2133.cpp

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ helpviewer_keywords: ["C2134"]
77
---
88
# Compiler Error C2134
99

10-
'function' : call does not result in a constant expression
10+
> 'function' : call does not result in a constant expression
11+
12+
## Remarks
1113

1214
A function declared as constexpr can only call other functions declared as constexpr.
1315

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

1620
```cpp
1721
// C2134.cpp

0 commit comments

Comments
 (0)