Skip to content

Commit 253eb62

Browse files
authored
Merge pull request #1754 from NextTurn/cpp-1
Add language identifiers
2 parents 941dec5 + 3ca1718 commit 253eb62

File tree

266 files changed

+619
-619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+619
-619
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Ending the first line with \n is not sufficient.
2121

2222
The following sample generates C2001:
2323

24-
```
24+
```cpp
2525
// C2001.cpp
2626
// C2001 expected
2727
#include <stdio.h>
@@ -39,7 +39,7 @@ int main()
3939

4040
Spaces at the beginning of the next line after a line-continuation character are included in the string constant. None of the examples shown above embed a newline character into the string constant. You can embed a newline character as shown here:
4141

42-
```
42+
```cpp
4343
// C2001b.cpp
4444
#include <stdio.h>
4545

@@ -63,4 +63,4 @@ int main()
6363
printf_s("Hello,\
6464
world");
6565
}
66-
```
66+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This error can also be generated as a result of compiler conformance work that w
1717

1818
The following sample generates C2004:
1919

20-
```
20+
```cpp
2121
// C2004.cpp
2222
// compile with: /DDEBUG
2323
#include <stdio.h>
@@ -34,7 +34,7 @@ int main()
3434
3535
Possible resolution:
3636
37-
```
37+
```cpp
3838
// C2004b.cpp
3939
// compile with: /DDEBUG
4040
#include <stdio.h>
@@ -45,4 +45,4 @@ int main()
4545
printf_s("DEBUG defined\n");
4646
#endif
4747
}
48-
```
48+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `#line` directive must be followed by a line number.
1313

1414
The following sample generates C2005:
1515

16-
```
16+
```cpp
1717
// C2005.cpp
1818
int main() {
1919
int i = 0;
@@ -23,10 +23,10 @@ int main() {
2323

2424
Possible resolution:
2525

26-
```
26+
```cpp
2727
// C2005b.cpp
2828
int main() {
2929
int i = 0;
3030
#line 0
3131
}
32-
```
32+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Directives such as [#include](../../preprocessor/hash-include-directive-c-cpp.md
1313

1414
The following sample generates C2006:
1515

16-
```
16+
```cpp
1717
// C2006.cpp
1818
#include stdio.h // C2006
1919
```
2020

2121
Possible resolution:
2222

23-
```
23+
```cpp
2424
// C2006b.cpp
2525
// compile with: /c
2626
#include <stdio.h>
27-
```
27+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ No identifier appears after a `#define`. To resolve the error, use an identifier
1313

1414
The following sample generates C2007:
1515

16-
```
16+
```cpp
1717
// C2007.cpp
1818
#define // C2007
1919
```
2020

2121
Possible resolution:
2222

23-
```
23+
```cpp
2424
// C2007b.cpp
2525
// compile with: /c
2626
#define true 1
27-
```
27+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ The character appears immediately following the macro name. To resolve the error
1313

1414
The following sample generates C2008:
1515

16-
```
16+
```cpp
1717
// C2008.cpp
1818
#define TEST1"mytest1" // C2008
1919
```
2020
2121
Possible resolution:
2222
23-
```
23+
```cpp
2424
// C2008b.cpp
2525
// compile with: /c
2626
#define TEST2 "mytest2"
27-
```
27+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The formal parameter list of a macro definition uses the identifier more than on
1515

1616
The following sample generates C2009:
1717

18-
```
18+
```cpp
1919
// C2009.cpp
2020
#include <stdio.h>
2121

@@ -31,7 +31,7 @@ int main()
3131

3232
Possible resolution:
3333

34-
```
34+
```cpp
3535
// C2009b.cpp
3636
#include <stdio.h>
3737

@@ -43,4 +43,4 @@ int main()
4343
printf_s("%d\n", macro2(2));
4444
printf_s("%d\n", macro3(2,4));
4545
}
46-
```
46+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ The character is used incorrectly in the formal parameter list of a macro defini
1313

1414
The following sample generates C2010:
1515

16-
```
16+
```cpp
1717
// C2010.cpp
1818
// compile with: /c
1919
#define mymacro(a|) (2*a) // C2010
2020
#define mymacro(a) (2*a) // OK
21-
```
21+
```

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ If you need to find the initial declaration of the redefined type, you can use t
1717

1818
The following sample generates C2011 and shows one way to fix it:
1919

20-
```
20+
```cpp
2121
// C2011.cpp
2222
// compile with: /c
2323
struct S;
2424
union S; // C2011
2525
union S2; // OK
26-
```
26+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ An `#include` directive lacks the required filename.
1313

1414
The following sample generates C2012:
1515

16-
```
16+
```cpp
1717
// C2012.cpp
1818
#include < // C2012 include the filename to resolve
1919
```
2020
2121
Possible resolution:
2222
23-
```
23+
```cpp
2424
// C2012b.cpp
2525
// compile with: /c
2626
#include <stdio.h>
27-
```
27+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ An `#include` directive lacks a closing angle bracket. Add the closing bracket t
1313

1414
The following sample generates C2013:
1515

16-
```
16+
```cpp
1717
// C2013.cpp
1818
#include <stdio.h // C2013
1919
```
2020
2121
Possible resolution:
2222
23-
```
23+
```cpp
2424
// C2013b.cpp
2525
// compile with: /c
2626
#include <stdio.h>
27-
```
27+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ The `#` sign of a preprocessor directive must be the first character on a line t
1313

1414
The following sample generates C2014:
1515

16-
```
16+
```cpp
1717
// C2014.cpp
1818
int k; #include <stdio.h> // C2014
1919
```
2020

2121
Possible resolution:
2222

23-
```
23+
```cpp
2424
// C2014b.cpp
2525
// compile with: /c
2626
int k;
2727
#include <stdio.h>
28-
```
28+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ An escape sequence, such as \t, is converted to a single character.
1717

1818
The following sample generates C2015:
1919

20-
```
20+
```cpp
2121
// C2015.cpp
2222
// compile with: /c
2323

@@ -29,7 +29,7 @@ char test2 = 'e'; // OK
2929

3030
C2015 can also occur when using a Microsoft extension, character constants converted to integers. The following sample generates C2015:
3131

32-
```
32+
```cpp
3333
// C2015b.cpp
3434
#include <stdio.h>
3535

@@ -40,4 +40,4 @@ int main()
4040
int b = 'a'; // 'a' = ascii 0x61
4141
printf_s("%x\n", b);
4242
}
43-
```
43+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ An escape sequence, such as \t, appears outside of a character or string constan
1313

1414
The following sample generates C2017:
1515

16-
```
16+
```cpp
1717
// C2017.cpp
1818
int main() {
1919
char test1='a'\n; // C2017
@@ -25,8 +25,8 @@ C2017 can occur when the stringize operator is used with strings that include es
2525

2626
The following sample generates C2017:
2727

28-
```
28+
```cpp
2929
// C2017b.cpp
3030
#define TestDfn(x) AfxMessageBox(#x)
3131
TestDfn(CString("\\") + CString(".h\"\n\n")); // C2017
32-
```
32+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ The character followed a `#` sign but it is not the first letter of a preprocess
1313

1414
The following sample generates C2019:
1515

16-
```
16+
```cpp
1717
// C2019.cpp
1818
#!define TRUE 1 // C2019
1919
```
2020

2121
Possible resolution:
2222

23-
```
23+
```cpp
2424
// C2019b.cpp
2525
// compile with: /c
2626
#define TRUE 1
27-
```
27+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The character used as the exponent of a floating-point constant is not a valid n
1515

1616
The following sample generates C2021:
1717

18-
```
18+
```cpp
1919
// C2021.cpp
2020
float test1=1.175494351E; // C2021
2121
```
@@ -24,8 +24,8 @@ float test1=1.175494351E; // C2021
2424

2525
Possible resolution:
2626

27-
```
27+
```cpp
2828
// C2021b.cpp
2929
// compile with: /c
3030
float test2=1.175494351E8;
31-
```
31+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A type cannot be used until it is defined. To resolve the error, be sure the typ
1515

1616
The following sample generates C2027.
1717

18-
```
18+
```cpp
1919
// C2027.cpp
2020
class C;
2121
class D {
@@ -39,7 +39,7 @@ It is possible to declare a pointer to a declared but undefined type. But C++ do
3939
4040
The following sample generates C2027.
4141
42-
```
42+
```cpp
4343
// C2027_b.cpp
4444
class A;
4545
A& CreateA();
@@ -51,4 +51,4 @@ int main() {
5151
CreateA(); // C2027
5252
CreateB(); // OK
5353
}
54-
```
54+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The bit field was declared as a pointer, which is not allowed.
1313

1414
The following sample generates C2033:
1515

16-
```
16+
```cpp
1717
// C2033.cpp
1818
struct S {
1919
int *b : 1; // C2033
@@ -22,10 +22,10 @@ struct S {
2222
2323
Possible resolution:
2424
25-
```
25+
```cpp
2626
// C2033b.cpp
2727
// compile with: /c
2828
struct S {
2929
int b : 1;
3030
};
31-
```
31+
```

0 commit comments

Comments
 (0)