Skip to content

Add language identifiers #1740

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
Nov 25, 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can also manually unpin the object and ignore the warning.

The following sample generates C4823.

```
```cpp
// C4823.cpp
// compile with: /clr /W3 /EHa-
using namespace System;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The compiler encountered a function that was marked with pragma [deprecated](../

The following sample generates C4995:

```
```cpp
// C4995.cpp
// compile with: /W3
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Under strict ANSI compatibility ([/Za](../../build/reference/za-ze-disable-langu

To disable warning, uncomment [#pragma warning(disable:4001)](../../preprocessor/warning.md).

```
```cpp
// C4001.cpp
// compile with: /W4 /Za /TC
// #pragma warning(disable:4001)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This warning may be fixed if you remove the extra semicolon.

## Example

```
```c
// C4019.c
// compile with: /Za /W4
#define declint( varname ) int varname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is an error in ANSI C ([/Za](../../build/reference/za-ze-disable-language-e

## Example

```
```c
// C4032.c
// compile with: /W4
void func();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ C4100 can also be issued when code calls a destructor on a otherwise unreference

The following sample generates C4100:

```
```cpp
// C4100.cpp
// compile with: /W4
void func(int i) { // C4100, delete the unreferenced parameter to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ms.assetid: 8c5b85c9-2543-426b-88bc-319c50158c7e

The compiler added padding to align a structure member on the packing boundary but the packing value is less than the member's size. For example, the following code snippet produces C4121:

```
```cpp
// C4121.cpp
// compile with: /W4 /c
#pragma pack(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The compiler evaluates the octal number without the decimal digit and assumes th

## Example

```
```cpp
// C4125a.cpp
// compile with: /W4
char array1[] = "\709"; // C4125
Expand All @@ -24,7 +24,7 @@ int main()

If the digit 9 is intended as a character, correct the example as follows:

```
```cpp
// C4125b.cpp
// compile with: /W4
char array[] = "\0709"; // C4125 String containing "89"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Using the operator with the address of a string literal produces unexpected code

The following sample generates C4130:

```
```cpp
// C4130.cpp
// compile with: /W4
int main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Old-style function declarations should be converted to prototype form.

The following example shows an old-style function declaration:

```
```c
// C4131.c
// compile with: /W4 /c
void addrec( name, id ) // C4131 expected
Expand All @@ -26,7 +26,7 @@ int id;

The following example shows a prototype form:

```
```c
void addrec( char *name, int id )
{ }
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A variable is declared and initialized but not used.

The following sample generates C4189:

```
```cpp
// C4189.cpp
// compile with: /W4
int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Under Microsoft extensions (/Ze), you can specify a structure without a declarat

## Example

```
```cpp
// C4201.cpp
// compile with: /W4
struct S
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ An old-style function definition contains variable arguments. These definitions

## Example

```
```c
// C4202.c
// compile with: /W4
void func( a, b, ...) // C4202
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ With Microsoft extensions (/Ze), you can initialize aggregate types (arrays, str

## Example

```
```c
// C4204.c
// compile with: /W4
int func1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ With Microsoft extensions (/Ze), **static** functions can be declared inside ano

## Example

```
```c
// C4205.c
// compile with: /W4
void func1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ With Microsoft extensions (/Ze), you can initialize an unsized array of `char` u

## Example

```
```c
// C4207.c
// compile with: /W4
char c[] = { 'a', 'b', "cdefg" }; // C4207
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nonstandard extension used : delete [exp] - exp evaluated but ignored

With Microsoft extensions (/Ze), you can delete an array using a value within brackets with the [delete operator](../../cpp/delete-operator-cpp.md). The value is ignored.

```
```cpp
// C4208.cpp
// compile with: /W4
int main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nonstandard extension used : function given file scope

With the default Microsoft extensions ([/Ze](../../build/reference/za-ze-disable-language-extensions.md)), function declarations have file scope.

```
```c
// C4210.c
// compile with: /W4 /c
void func1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ With the default Microsoft extensions (/Ze), you can redefine an `extern` identi

## Example

```
```c
// C4211.c
// compile with: /W4
extern int i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The function prototype has a variable number of arguments. The function definiti

The following sample generates C4212:

```
```c
// C4212.c
// compile with: /W4 /Ze /c
void f(int , ...);
Expand Down