title | description | ms.date | f1_keywords | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Compiler warnings C4200 Through C4399 |
Table of Microsoft C/C++ compiler warnings C4200 through C4389. |
10/18/2020 |
|
The articles in this section of the documentation explain a subset of the warning messages that are generated by the compiler.
[!INCLUDEerror-boilerplate]
Warning | Message |
---|---|
Compiler warning (levels 2 and 4) C4200 | nonstandard extension used: zero-sized array in struct/union |
Compiler warning (level 4) C4201 | nonstandard extension used: nameless struct/union |
Compiler warning (level 4) C4202 | nonstandard extension used: '...': prototype parameter in name list illegal |
Compiler warning C4203 | nonstandard extension used: union with static member variable |
Compiler warning (level 4) C4204 | nonstandard extension used: non-constant aggregate initializer |
Compiler warning (level 4) C4205 | nonstandard extension used: static function declaration in function scope |
Compiler warning (level 4) C4206 | nonstandard extension used: translation unit is empty |
Compiler warning (level 4) C4207 | nonstandard extension used: extended initializer form |
Compiler warning (level 4) C4208 | nonstandard extension used: delete [exp] - exp evaluated but ignored |
Compiler warning (level 4) C4210 | nonstandard extension used: function given file scope |
Compiler warning (level 4) C4211 | nonstandard extension used: redefined extern to static |
Compiler warning (level 4) C4212 | nonstandard extension used: function declaration used ellipsis |
Compiler warning (level 4) C4213 | nonstandard extension used: cast on l-value |
Compiler warning (level 4) C4214 | nonstandard extension used: bit field types other than int |
Compiler warning (level 1) C4215 | nonstandard extension used: long float |
Compiler warning (level 1) C4216 | nonstandard extension used: float long |
Compiler warning (level 1) C4218 | nonstandard extension used: must specify at least a storage class or a type |
Compiler warning (level 4) C4220 | varargs matches remaining parameters |
Compiler warning (level 4) C4221 | nonstandard extension used: 'identifier': cannot be initialized using address of automatic variable 'variable' |
Compiler warning (levels 1 and 4) C4223 | nonstandard extension used: non-lvalue array converted to pointer |
Compiler warning (level 1) C4224 | nonstandard extension used: formal parameter 'identifier' was previously defined as a type |
Compiler warning (level 1, Error) C4226 | nonstandard extension used: 'keyword' is an obsolete keyword |
Compiler warning (level 1) C4227 | anachronism used: qualifiers on reference are ignored |
Compiler warning (level 1) C4228 | nonstandard extension used: qualifiers after comma in declarator list are ignored |
Compiler warning (level 1) C4229 | anachronism used: modifiers on data are ignored |
Compiler warning (level 1) C4230 | anachronism used: modifiers/qualifiers interspersed; qualifier ignored |
Compiler warning (level 4) C4232 | nonstandard extension used: 'identifier': address of dllimport 'dllimport' is not static, identity not guaranteed |
Compiler warning (level 4, Error) C4233 | nonstandard extension used: 'keyword' keyword only supported in C++, not C |
Compiler warning (level 4, Error) C4234 | nonstandard extension used: 'keyword' keyword reserved for future use |
Compiler warning (level 4, Error) C4235 | nonstandard extension used: 'keyword' keyword not supported on this architecture |
Compiler warning (level 1) C4237 | 'keyword' keyword is not yet supported, but reserved for future use |
Compiler warning (level 4) C4238 | nonstandard extension used: class rvalue used as lvalue |
Compiler warning (level 4) C4239 | nonstandard extension used: 'token': conversion from 'type1' to 'type2' |
Compiler warning (level 3) C4240 | nonstandard extension used: access to 'classname' now defined to be 'access_specifier1', previously it was defined to be 'access_specifier2' |
Compiler warning (level 4) C4242 | 'identifier': conversion from 'type1' to 'type2', possible loss of data |
Compiler warning (level 3) C4243 | 'conversion_type' conversion from 'type1' to 'type2' exists, but is inaccessible |
Compiler warning (level 2) C4244 | 'conversion_type': conversion from 'type1' to 'type2', possible loss of data |
Compiler warning (levels 3 and 4) C4244 | 'conversion_type': conversion from 'type1' to 'type2', possible loss of data |
Compiler warning (level 4) C4245 | 'conversion_type': conversion from 'type1' to 'type2', signed/unsigned mismatch |
Compiler warning (level 2) C4250 | 'classname': inherits 'base_classname::member' via dominance |
Compiler warning (level 1) C4251 | 'identifier': 'object_type1' 'identifier1' needs to have dll-interface to be used by clients of 'object_type' 'identfier2' |
Compiler warning (level 4) C4254 | 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data |
Compiler warning (level 4) C4255 | 'function': no function prototype given: converting '()' to '(void)' |
Compiler warning (level 4) C4256 | 'function': constructor for class with virtual bases has '...'; calls may not be compatible with older versions of Visual C++ |
Compiler warning (level 1) C4258 | 'variable': definition from the for loop is ignored; the definition from the enclosing scope is used |
Compiler warning (level 4) C4263 | 'function': member function does not override any base class virtual member function |
Compiler warning (level 1) C4264 | 'virtual_function': no override available for virtual member function from base 'classname'; function is hidden |
Compiler warning (level 3) C4265 | 'classname': class has virtual functions, but destructor is not virtual\n instances of this class may not be destructed correctly |
Compiler warning (level 4) C4266 | 'virtual_function': no override available for virtual member function from base 'classname'; function is hidden |
Compiler warning (level 3) C4267 | 'variable': conversion from 'size_t' to 'type', possible loss of data |
Compiler warning (level 4) C4268 | 'identifier': 'const' static/global data initialized with compiler generated default constructor fills the object with zeros |
Compiler warning (level 1) C4269 | 'identifier': 'const' automatic data initialized with compiler generated default constructor produces unreliable results |
Compiler warning (level 1) C4272 | 'function': is marked __declspec(dllimport); must specify native calling convention when importing a function. |
Compiler warning (level 1) C4273 | 'function': inconsistent dll linkage |
Compiler warning (level 1) C4274 | #ident ignored; see documentation for #pragma comment(exestr, 'string') |
Compiler warning (level 2) C4275 | non dll-interface 'classkey' 'identifier1' used as base for dll-interface 'classkey' 'identifier2' |
Compiler warning (level 1) C4276 | 'function': no prototype provided; assumed no parameters |
Compiler warning (level 1) C4277 | imported item 'classname::member' exists as both data member and function member; data member ignored |
Compiler warning (level 3) C4278 | 'identifier': identifier in type library 'library' is already a macro; use the 'rename' qualifier |
Compiler warning (level 3 and level 4) C4279 | 'identifier': identifier in type library 'library' is a keyword; use the 'rename' qualifier |
Compiler warning (level 3) C4280 | 'operator ->' was self recursive through type 'type' |
Compiler warning (level 3) C4281 | 'operator ->' recursion occurred through type 'type1' |
Compiler warning (level 3) C4282 | then through type 'type2' |
Compiler warning (level 3) C4283 | and through type 'typeN' |
Compiler warning (level 2) C4285 | return type for 'identifier::operator ->' is recursive if applied using infix notation |
Compiler warning (level 1) C4286 | 'derived_type': is caught by base class ('base_type') on line 'line_number' |
Compiler warning (level 3) C4287 | 'operator': unsigned/negative constant mismatch |
Compiler warning (level 1) C4288 | nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside the for-loop scope; it conflicts with the declaration in the outer scope |
Compiler warning (level 4) C4289 | nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside the for-loop scope |
Compiler warning (level 3) C4290 | C++ exception specification ignored except to indicate a function is not __declspec(nothrow) |
Compiler warning (level 1) C4291 | 'declaration': no matching operator delete found; memory will not be freed if initialization throws an exception |
Compiler warning (level 1) C4293 | 'shift_operator': shift count negative or too big, undefined behavior |
Compiler warning (level 4) C4295 | 'array': array is too small to include a terminating null character |
Compiler warning (level 4) C4296 | 'operator': expression is always 'boolean_value' |
Compiler warning (level 1) C4297 | 'function': function assumed not to throw an exception but does |
Compiler warning (level 4) C4298 | 'identifier': identifier in type library 'library' is already a macro; renaming to '__identifier' |
Compiler warning (level 4) C4299 | 'identifier': identifier in type library 'library' is a keyword; renaming to '__identifier' |
Compiler warning C4301 | 'derived_class::function': overriding virtual function only differs from 'base_class::function' by const/volatile qualifier |
Compiler warning (level 2) C4302 | 'conversion': truncation from 'type1' to 'type2' |
Compiler warning C4303 | C-style cast from 'type1' to 'type2' is deprecated, use static_cast, __try_cast or dynamic_cast |
Compiler warning (level 1) C4305 | 'conversion': truncation from 'type1' to 'type2' |
Compiler warning (level 3) C4306 | 'conversion': conversion from 'type1' to 'type2' of greater size |
Compiler warning (level 2) C4307 | 'operator': integral constant overflow |
Compiler warning (level 2) C4308 | negative integral constant converted to unsigned type |
Compiler warning (level 2) C4309 | 'conversion': truncation of constant value |
Compiler warning (level 3) C4310 | cast truncates constant value |
Compiler warning (level 1) C4311 | 'variable': pointer truncation from 'type1' to 'type2' |
Compiler warning (level 1) C4312 | 'operation': conversion from 'type1' to 'type2' of greater size |
Compiler warning (level 1) C4313 | 'function': 'format_specifier' in format string conflicts with argument 'argument_number' of type 'type' |
Compiler warning C4314 | expected pragma parameter to be '32' or '64' |
Compiler warning (level 4) C4315 | 'classname': 'this' pointer for member 'member' may not be aligned 'alignment' as expected by the constructor |
Compiler warning (level 3) C4316 | 'identifier': object allocated on the heap may not be aligned 'alignment' |
Compiler warning (level 1) C4317 | 'printf_family' : not enough arguments passed for format string |
Compiler warning C4318 | passing constant zero as the length to memset |
Compiler warning (level 1) C4319 | 'operator': zero extending 'type1' to 'type2' of greater size |
Compiler warning (level 1) C4321 | automatically generating an IID for interface 'interface' |
Compiler warning (level 1) C4322 | automatically generating a CLSID for class 'class' |
Compiler warning (level 1) C4323 | re-using registered CLSID for class 'class' |
Compiler warning (level 4) C4324 | 'structname': structure was padded due to __declspec(align()) |
Compiler warning (level 1) C4325 | attributes for standard section 'section' ignored |
Compiler warning (level 1) C4326 | return type of 'function' should be 'type1' instead of 'type2' |
Compiler warning C4327 | 'assignment': indirection alignment of LHS ('alignment1') is greater than RHS ('alignment2') |
Compiler warning C4328 | 'function': indirection alignment of formal parameter parameter_number (parameter_alignment) is greater than the actual argument alignment (argument_alignment) |
Compiler warning (level 1) C4329 | __declspec(align()) is ignored on enum |
Compiler warning (level 1) C4330 | attribute 'attribute' for section 'section' ignored |
Compiler warning (level 1) C4333 | 'shift_operator': right shift by too large amount, data loss |
Compiler warning (level 3) C4334 | 'shift_operator': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) |
Compiler warning C4335 | Mac file format detected: please convert the source file to either DOS or UNIX format |
Compiler warning (level 4) C4336 | import cross-referenced type library 'library1' before importing 'library2' |
Compiler warning (level 4) C4337 | cross-referenced type library 'library1' in 'library2' is being automatically imported |
Compiler warning (level 4) C4338 | #pragma directive: standard section 'section' is used |
Compiler warning (level 4) C4339 | 'type': use of undefined type detected in 'WinRT|CLR' meta-data - use of this type may lead to a runtime exception |
Compiler warning (level 1) C4340 | 'value': value wrapped from positive to negative value |
Compiler warning (level 1) C4342 | behavior change: 'function' called, but a member operator was called in previous versions |
Compiler warning (level 4) C4343 | #pragma optimize("g",off) overrides /Og option |
Compiler warning (level 1) C4344 | behavior change: use of explicit template arguments results in call to 'function' |
Compiler warning (level 1) C4346 | 'name': dependent name is not a type |
Compiler warning (level 1) C4348 | 'type': redefinition of default parameter: parameter 'parameter_number' |
Compiler warning (level 1) C4350 | behavior change: 'member1' called instead of 'member2' |
Compiler warning (level 1) C4352 | 'identifier': intrinsic function already defined |
Compiler warning (level 1) C4353 | nonstandard extension used: constant 0 as function expression. Use '__noop' function intrinsic instead |
Compiler warning C4355Compiler warning (level 1 and level 4) C4355 | 'this': used in base member initializer list |
Compiler warning (level 2) C4356 | 'member': static data member cannot be initialized via derived class |
Compiler warning (level 3) C4357 | param array argument found in formal argument list for delegate 'delegate' ignored when generating 'function' |
Compiler warning (level 1) C4358 | 'operator': return type of combined delegates is not 'void'; returned value is undefined |
Compiler warning (level 3) C4359 | 'type': Alignment specifier is less than actual alignment ('alignment'), and will be ignored. |
Compiler warning (level 2) C4362 | 'type': alignment greater than 8 bytes is not supported by CLR |
Compiler warning (level 1) C4364 | #using for assembly 'assembly' previously seen at 'location'('line_number') without as_friend attribute; as_friend not applied |
Compiler warning (level 4) C4365 | 'expression': conversion from 'type1' to 'type2', signed/unsigned mismatch |
Compiler warning (level 4) C4366 | The result of the unary 'operator' operator may be unaligned |
Compiler warning (level 3) C4367 | Conversion from 'type1' to 'type2' may cause datatype misalignment exception |
Compiler warning (Error) C4368 | cannot define 'member' as a member of managed 'type': mixed types are not supported |
Compiler warning (level 1) C4369 | 'enumerator': enumerator value 'value' cannot be represented as 'type', value is 'new_value' |
Compiler warning C4370 | 'classname': layout of class has changed from a previous version of the compiler due to better packing |
Compiler warning (level 3) C4371 | 'classname': layout of class may have changed from a previous version of the compiler due to better packing of member 'member' |
Compiler warning (level 3) C4373 | 'derived_class::function': virtual function overrides 'base_class::function', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers |
Compiler warning (level 1) C4374 | 'function1': interface method will not be implemented by non-virtual method 'function2' |
Compiler warning (level 1) C4375 | non-public method 'method2' does not override 'method2' |
Compiler warning (level 1) C4376 | access specifier 'old_specifier:' is no longer supported: please use 'new_specifier:' instead |
Compiler warning (level 1) C4377 | native types are private by default; -d1PrivateNativeTypes is deprecated |
Compiler warning (level 1) C4378 | Must obtain function pointers to run initializers; consider System::ModuleHandle::ResolveMethodHandle |
Compiler warning (level 1) C4379 | Version 'version_number' of the common language runtime is not supported by this compiler. Using this version may cause unexpected results |
Compiler warning (level 1, Error) C4380 | 'class': A default constructor cannot be deprecated |
Compiler warning (level 1) C4381 | 'function1': interface method will not be implemented by non-public method 'function2' |
Compiler warning (level 1) C4382 | throwing 'type': a type with __clrcall destructor or copy constructor can only be caught in /clr:pure module |
Compiler warning (level 1) C4383 | 'instance_dereference_operator': the meaning of dereferencing a handle can change, when a user-defined 'instance_dereference_operator' operator exists; write the operator as a static function to be explicit about the operand |
Compiler warning (level 1) C4384 | #pragma 'make_public' should only be used at global scope |
Compiler warning (level 3) C4387 | 'alternative': was considered |
Compiler warning (level 4) C4388) | 'expression': signed/unsigned mismatch |
Compiler warning (level 4) C4389 | 'operator': signed/unsigned mismatch |
Compiler warning (level 3) C4390 | ';': empty controlled statement found; is this the intent? |
Compiler warning (level 1) C4391 | 'function_signature': incorrect return type for intrinsic function, expected 'type' |
Compiler warning (level 1) C4392 | 'function_signature': incorrect number of arguments for intrinsic function, expected 'argument_count' arguments |
Compiler warning (level 1) C4393 | 'variable': const has no effect on 'literal' data member; ignored |
Compiler warning C4394 | 'function': per-appdomain symbol should not be marked with __declspec('dllexport') |
Compiler warning (level 1) C4395 | 'function': member function will be invoked on a copy of the initonly data member 'member' |
Compiler warning (level 2) C4396 | 'function': the inline specifier cannot be used when a friend declaration refers to a specialization of a function template |
Compiler warning (level 1) C4397 | DefaultCharSetAttribute is ignored |
Compiler warning (level 3) C4398 | 'variable': per-process global object might not work correctly with multiple appdomains; consider using __declspec(appdomain) |
Compiler warning (level 1) C4399 | 'symbol': per-process symbol should not be marked with __declspec('dllimport') when compiled with /clr:pure |
C/C++ Compiler and build tools errors and warnings
Compiler warnings C4000 - C5999