Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 813 Bytes

compiler-warning-level-2-c4307.md

File metadata and controls

26 lines (21 loc) · 813 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 2) C4307
Compiler Warning (level 2) C4307
11/04/2016
C4307
C4307
7cca11e9-be61-49e4-8b15-88b84f0cbf07

Compiler Warning (level 2) C4307

'operator' : integral constant overflow

The operator is used in an expression that results in an integer constant overflowing the space allocated for it. You may need to use a larger type for the constant. A signed int holds a smaller value than an unsigned int because the signed int uses one bit to represent the sign.

The following sample generates C4307:

// C4307.cpp
// compile with: /W2
int i = 2000000000 + 2000000000;   // C4307
int j = (unsigned)2000000000 + 2000000000;   // OK

int main()
{
}