Skip to content

Add language identifiers #1754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2001.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Ending the first line with \n is not sufficient.

The following sample generates C2001:

```
```cpp
// C2001.cpp
// C2001 expected
#include <stdio.h>
Expand All @@ -39,7 +39,7 @@ int main()

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:

```
```cpp
// C2001b.cpp
#include <stdio.h>

Expand All @@ -63,4 +63,4 @@ int main()
printf_s("Hello,\
world");
}
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2004.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This error can also be generated as a result of compiler conformance work that w

The following sample generates C2004:

```
```cpp
// C2004.cpp
// compile with: /DDEBUG
#include <stdio.h>
Expand All @@ -34,7 +34,7 @@ int main()

Possible resolution:

```
```cpp
// C2004b.cpp
// compile with: /DDEBUG
#include <stdio.h>
Expand All @@ -45,4 +45,4 @@ int main()
printf_s("DEBUG defined\n");
#endif
}
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2005.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `#line` directive must be followed by a line number.

The following sample generates C2005:

```
```cpp
// C2005.cpp
int main() {
int i = 0;
Expand All @@ -23,10 +23,10 @@ int main() {

Possible resolution:

```
```cpp
// C2005b.cpp
int main() {
int i = 0;
#line 0
}
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2006.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Directives such as [#include](../../preprocessor/hash-include-directive-c-cpp.md

The following sample generates C2006:

```
```cpp
// C2006.cpp
#include stdio.h // C2006
```

Possible resolution:

```
```cpp
// C2006b.cpp
// compile with: /c
#include <stdio.h>
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2007.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ No identifier appears after a `#define`. To resolve the error, use an identifier

The following sample generates C2007:

```
```cpp
// C2007.cpp
#define // C2007
```

Possible resolution:

```
```cpp
// C2007b.cpp
// compile with: /c
#define true 1
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2008.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ The character appears immediately following the macro name. To resolve the error

The following sample generates C2008:

```
```cpp
// C2008.cpp
#define TEST1"mytest1" // C2008
```

Possible resolution:

```
```cpp
// C2008b.cpp
// compile with: /c
#define TEST2 "mytest2"
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2009.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The formal parameter list of a macro definition uses the identifier more than on

The following sample generates C2009:

```
```cpp
// C2009.cpp
#include <stdio.h>

Expand All @@ -31,7 +31,7 @@ int main()

Possible resolution:

```
```cpp
// C2009b.cpp
#include <stdio.h>

Expand All @@ -43,4 +43,4 @@ int main()
printf_s("%d\n", macro2(2));
printf_s("%d\n", macro3(2,4));
}
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-1/compiler-error-c2010.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The character is used incorrectly in the formal parameter list of a macro defini

The following sample generates C2010:

```
```cpp
// C2010.cpp
// compile with: /c
#define mymacro(a|) (2*a) // C2010
#define mymacro(a) (2*a) // OK
```
```
4 changes: 2 additions & 2 deletions docs/error-messages/compiler-errors-1/compiler-error-c2011.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ If you need to find the initial declaration of the redefined type, you can use t

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

```
```cpp
// C2011.cpp
// compile with: /c
struct S;
union S; // C2011
union S2; // OK
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2012.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ An `#include` directive lacks the required filename.

The following sample generates C2012:

```
```cpp
// C2012.cpp
#include < // C2012 include the filename to resolve
```

Possible resolution:

```
```cpp
// C2012b.cpp
// compile with: /c
#include <stdio.h>
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2013.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ An `#include` directive lacks a closing angle bracket. Add the closing bracket t

The following sample generates C2013:

```
```cpp
// C2013.cpp
#include <stdio.h // C2013
```

Possible resolution:

```
```cpp
// C2013b.cpp
// compile with: /c
#include <stdio.h>
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2014.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ The `#` sign of a preprocessor directive must be the first character on a line t

The following sample generates C2014:

```
```cpp
// C2014.cpp
int k; #include <stdio.h> // C2014
```

Possible resolution:

```
```cpp
// C2014b.cpp
// compile with: /c
int k;
#include <stdio.h>
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2015.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An escape sequence, such as \t, is converted to a single character.

The following sample generates C2015:

```
```cpp
// C2015.cpp
// compile with: /c

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

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

```
```cpp
// C2015b.cpp
#include <stdio.h>

Expand All @@ -40,4 +40,4 @@ int main()
int b = 'a'; // 'a' = ascii 0x61
printf_s("%x\n", b);
}
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2017.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ An escape sequence, such as \t, appears outside of a character or string constan

The following sample generates C2017:

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

The following sample generates C2017:

```
```cpp
// C2017b.cpp
#define TestDfn(x) AfxMessageBox(#x)
TestDfn(CString("\\") + CString(".h\"\n\n")); // C2017
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2019.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ The character followed a `#` sign but it is not the first letter of a preprocess

The following sample generates C2019:

```
```cpp
// C2019.cpp
#!define TRUE 1 // C2019
```

Possible resolution:

```
```cpp
// C2019b.cpp
// compile with: /c
#define TRUE 1
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2021.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The character used as the exponent of a floating-point constant is not a valid n

The following sample generates C2021:

```
```cpp
// C2021.cpp
float test1=1.175494351E; // C2021
```
Expand All @@ -24,8 +24,8 @@ float test1=1.175494351E; // C2021

Possible resolution:

```
```cpp
// C2021b.cpp
// compile with: /c
float test2=1.175494351E8;
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2027.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A type cannot be used until it is defined. To resolve the error, be sure the typ

The following sample generates C2027.

```
```cpp
// C2027.cpp
class C;
class D {
Expand All @@ -39,7 +39,7 @@ It is possible to declare a pointer to a declared but undefined type. But C++ do

The following sample generates C2027.

```
```cpp
// C2027_b.cpp
class A;
A& CreateA();
Expand All @@ -51,4 +51,4 @@ int main() {
CreateA(); // C2027
CreateB(); // OK
}
```
```
6 changes: 3 additions & 3 deletions docs/error-messages/compiler-errors-1/compiler-error-c2033.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The bit field was declared as a pointer, which is not allowed.

The following sample generates C2033:

```
```cpp
// C2033.cpp
struct S {
int *b : 1; // C2033
Expand All @@ -22,10 +22,10 @@ struct S {

Possible resolution:

```
```cpp
// C2033b.cpp
// compile with: /c
struct S {
int b : 1;
};
```
```
Loading