编译器警告 C4430

缺少类型说明符 - 假定为 int。 注意:C++ 不支持默认的 int

为 Visual Studio 2005 执行的编译器一致性工作可能会生成此错误:所有声明都必须显式指定类型;不再假定 int。

始终发出 C4430 错误。 可以使用 #pragma warning/wd 关闭此警告;请参阅警告/w、/W0、/W1、/W2、/W3、/W4、/w1、/w2、/w3、/w4、/Wall、/wd、/we 、/wo、/Wv、/WX(警告级别)了解详细信息。

示例

以下示例生成 C4430。

// C4430.cpp
// compile with: /c
struct CMyClass {
   CUndeclared m_myClass;  // C4430
   int m_myClass;  // OK
};

typedef struct {
   POINT();   // C4430
   // try the following line instead
   // int POINT();
   unsigned x;
   unsigned y;
} POINT;