Skip to content

Add language identifiers #1662

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
Oct 30, 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 @@ -13,7 +13,7 @@ The attribute is not a valid attribute of `#import`. It is ignored.

## Example

```
```cpp
// C4185.cpp
// compile with: /W1 /c
#import "stdole2.tlb" no_such_attribute // C4185
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A `#import` attribute has the wrong number of arguments.

## Example

```
```cpp
// C4186.cpp
// compile with: /W1 /c
#import "stdole2.tlb" no_namespace("abc") rename("a","b","c") // C4186
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The default Microsoft extensions (/Ze) treat **long float** as **double**. ANSI

The following sample generates C4215:

```
```cpp
// C4215.cpp
// compile with: /W1 /LD
long float a; // C4215
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nonstandard extension used : float long

The default Microsoft extensions (/Ze) treat **float long** as **double**. ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)) does not. Use **double** to maintain compatibility. The following sample generates C4216:

```
```cpp
// C4216.cpp
// compile with: /W1
float long a; // C4216
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 declare a variable without

## Example

```
```cpp
// C4218.c
// compile with: /W4
i; // C4218
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The identifier was previously used as a `typedef`. This causes a warning under A

## Example

```
```cpp
// C4224.cpp
// compile with: /Za /W1 /LD
typedef int I;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Using qualifiers like `const` or `volatile` with C++ references is an outdated p

## Example

```
```cpp
// C4227.cpp
// compile with: /W1 /c
int j = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use of qualifiers like **const** or `volatile` after a comma when declaring vari

## Example

```
```cpp
// C4228.cpp
// compile with: /W1
int j, const i = 0; // C4228
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Using a Microsoft modifier such as `__cdecl` on a data declaration is an outdate

## Example

```
```cpp
// C4229.cpp
// compile with: /W1 /LD
int __cdecl counter; // C4229 cdecl ignored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Using a qualifier before a Microsoft modifier such as `__cdecl` is an outdated p

## Example

```
```cpp
// C4230.cpp
// compile with: /W1 /LD
int __cdecl const function1(); // C4230 const ignored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A keyword in the C++ specification is not implemented in the Microsoft C++ compi

The following sample generates C4237:

```
```cpp
// C4237.cpp
// compile with: /W1 /c
int export; // C4237
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ms.assetid: bbb75e6d-6693-4e62-8ed3-b006a0ec55e3

Under [/Ze](../../build/reference/za-ze-disable-language-extensions.md) and [/Zc:forScope](../../build/reference/zc-forscope-force-conformance-in-for-loop-scope.md), variables defined in a [for](../../cpp/for-statement-cpp.md) loop go out of scope after the **for** loop ends. This warning occurs if a variable with the same name as the loop variable, but defined in the enclosing loop, is used again in the scope containing the **for** loop. For example:

```
```cpp
// C4258.cpp
// compile with: /Zc:forScope /W1
int main()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A **const** automatic instance of a non-trivial class is initialized with a comp

## Example

```
```cpp
// C4269.cpp
// compile with: /c /LD /W1
class X {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It is an error to export a function marked with the [__clrcall](../../cpp/clrcal

The following sample generates C4272:

```
```cpp
// C4272.cpp
// compile with: /c /W1 /clr
__declspec(dllimport) void __clrcall Test(); // C4272
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Two definitions in a file differ in their use of [dllimport](../../cpp/dllexport

The following sample generates C4273.

```
```cpp
// C4273.cpp
// compile with: /W1 /c
char __declspec(dllimport) c;
Expand All @@ -26,7 +26,7 @@ char c; // C4273, delete this line or the line above to resolve

The following sample generates C4273.

```
```cpp
// C4273_b.cpp
// compile with: /W1 /clr /c
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The specified exception type is handled by a previous handler. The type for the

## Example

```
```cpp
//C4286.cpp
// compile with: /W1
#include <eh.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See [/Zc:forScope](../../build/reference/zc-forscope-force-conformance-in-for-lo

The following sample generates C4288:

```
```cpp
// C4288.cpp
// compile with: /W1 /c /Zc:forScope-
int main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you use the operator **new** without any extra arguments and compile with [/G

If you use the placement form of the **new** operator (the form with arguments in addition to the size of the allocation) and the object's constructor throws an exception, the compiler will still generate code to call operator **delete**; but it will only do so if a placement form of operator **delete** exists matching the placement form of the operator **new** that allocated the memory. For example:

```
```cpp
// C4291.cpp
// compile with: /EHsc /W1
#include <malloc.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If a shift count is negative or too large, the behavior of the resulting image i

The following sample generates C4293:

```
```cpp
// C4293.cpp
// compile with: /c /W1
unsigned __int64 combine (unsigned lo, unsigned hi) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This warning is also generated for __declspec([dllexport](../../cpp/dllexport-dl

The following sample generates C4297:

```
```cpp
// C4297.cpp
// compile with: /W1 /LD
void __declspec(nothrow) f1() // declared nothrow
Expand Down