Muokkaa

Jaa


Microsoft C/C++ compiler warnings C4400 through C4599

The articles in this section describe Microsoft C/C++ compiler warning messages C4400-C4599.

Important

The Visual Studio compilers and build tools can report many kinds of errors and warnings. After an error or warning is found, the build tools may make assumptions about code intent and attempt to continue, so that more issues can be reported at the same time. If the tools make the wrong assumption, later errors or warnings may not apply to your project. When you correct issues in your project, always start with the first error or warning that's reported, and rebuild often. One fix may make many subsequent errors go away.

To get help on a particular diagnostic message in Visual Studio, select it in the Output window and press the F1 key. Visual Studio opens the documentation page for that error, if one exists. You can also use the search tool at the top of the page to find articles about specific errors or warnings. Or, browse the list of errors and warnings by tool and type in the table of contents on this page.

Note

Not every Visual Studio error or warning is documented. In many cases, the diagnostic message provides all of the information that's available. If you landed on this page when you used F1 and you think the error or warning message needs additional explanation, let us know. You can use the feedback buttons on this page to raise a documentation issue on GitHub. If you think the error or warning is wrong, or you've found another problem with the toolset, report a product issue on the Developer Community site. You can also send feedback and enter bugs within the IDE. In Visual Studio, go to the menu bar and choose Help > Send Feedback > Report a Problem, or submit a suggestion by using Help > Send Feedback > Send a Suggestion. Some compiler error topics were created that are not emitted by the compiler and now redirect to this page instead.

You may find additional assistance for errors and warnings in Microsoft Learn Q&A forums. Or, search for the error or warning number on the Visual Studio C++ Developer Community site. You can also search Stack Overflow to find solutions.

For links to additional help and community resources, see Visual C++ Help and Community.

Warning messages

Warning Message
Compiler warning (level 1) C4600 #pragma 'macro name': expected a valid non-empty string
Compiler warning (level 4) C4400 'type': const/volatile qualifiers on this type are not supported
Compiler warning (level 1) C4401 'bitfield': member is bit field
Compiler warning (level 1) C4402 must use PTR operator
Compiler warning (level 1) C4403 illegal PTR operator
Compiler warning (level 3) C4404 period on directive ignored
Compiler warning (level 1) C4405 'identifier': identifier is reserved word
Compiler warning (level 1) C4406 operand on directive ignored
Compiler warning (level 1) C4407 cast between different pointer to member representations, compiler may generate incorrect code
Compiler warning (level 4) C4408 anonymous 'struct|union' did not declare any data members
Compiler warning (level 1) C4409 illegal instruction size
Compiler warning (level 1) C4410 illegal size for operand
Compiler warning (level 1) C4411 'identifier': symbol resolves to displacement register
Compiler warning (level 2) C4412 'function': function signature contains type 'type'; C++ objects are unsafe to pass between pure code and mixed or native.
Compiler warning C4413 'classname::member': reference member is initialized to a temporary that doesn't persist after the constructor exits
Compiler warning (level 3) C4414 'function': short jump to function converted to near
Compiler warning (level 1) C4415 duplicate __declspec(code_seg('name'))
Compiler warning (level 1) C4416 __declspec(code_seg(...)) contains empty string: ignored
Compiler warning (level 1) C4417 an explicit template instantiation cannot have __declspec(code_seg(...)): ignored
Compiler warning (level 1) C4418 __declspec(code_seg(...)) ignored on an enum
Compiler warning (level 3) C4419 'symbol' has no effect when applied to private ref class 'class'.
Compiler warning (level 1) C4420 'checked_operator': operator not available, using 'operator' instead; run-time checking may be compromised
Compiler warning (level 3) C4421 'parameter': a reference parameter on a resumable function is potentially unsafe
Compiler warning (level 3) C4423 'std::bad_alloc': will be caught by class ('type') on line number
Compiler warning (level 3) C4424 catch for 'type1' preceded by 'type2' on line number; unpredictable behavior may result if 'std::bad_alloc' is thrown
Compiler warning (level 1) C4425 A SAL annotation cannot be applied to '...'
Compiler warning (level 1) C4426 optimization flags changed after including header, may be due to #pragma optimize()
Compiler warning (level 1) C4427 'operator': overflow in constant division, undefined behavior
Compiler warning (level 4) C4429 possible incomplete or improperly formed universal-character-name
Compiler warning (Error) C4430 missing type specifier - int assumed. Note: C++ does not support default-int
Compiler warning (level 4) C4431 missing type specifier - int assumed. Note: C no longer supports default-int
Compiler warning (level 4) C4434 a static constructor must have private accessibility; changing to private access
Compiler warning (level 4) C4435 'derived_class': Object layout under /vd2 will change due to virtual base 'base_class'
Compiler warning (level 1) C4436 dynamic_cast from virtual base 'base_class' to 'derived_class' in constructor or destructor could fail with partially-constructed object
Compiler warning (level 4) C4437 dynamic_cast from virtual base 'base_class' to 'derived_class' could fail in some contexts
Compiler warning C4438 'function': cannot be called safely in /await:clrcompat mode. If 'function' calls into the CLR it may result in CLR head corruption
Compiler warning (Error) C4439 'function': function definition with a managed type in the signature must have a __clrcall calling convention
Compiler warning (level 1) C4440 calling convention redefinition from 'calling_convention1' to 'calling_convenction2' ignored
Compiler warning (level 1) C4441 calling convention of 'calling_convention1' ignored; 'calling_convention2' used instead
Compiler warning (level 1) C4442 embedded null terminator in __annotation argument. Value will be truncated.
Compiler warning (level 1) C4443 expected pragma parameter to be '0', '1', or '2'
Compiler warning (level 3) C4444 'identifier': top level '__unaligned' is not implemented in this context
Compiler warning (level 1) C4445 'function': in a 'WinRT|managed' type a virtual method cannot be private
Compiler warning (level 1) C4446 'type': cannot map member 'name1' into this type, due to conflict with the type name. The method was renamed to 'name2'
Compiler warning (level 1) C4447 'main' signature found without threading model. Consider using 'int main(Platform::Array<Platform::String^>^ args)'.
Compiler warning C4448 'type1' does not have a default interface specified in metadata. Picking: 'type2', which may fail at runtime.
Compiler warning C4449 'type' an unsealed type should be marked as '[WebHostHidden]'
Compiler warning C4450 'type1' should be marked as '[WebHostHidden]' because it derives from 'type2'
Compiler warning (level 4) C4451 'classname1::member': Usage of ref class 'classname2::member' inside this context can lead to invalid marshaling of object across contexts
Compiler warning (level 1) C4452 'identifier': public type cannot be at global scope. It must be in a namespace that is a child of the name of the output .winmd file.
Compiler warning (level 1) C4453 'type': A '[WebHostHidden]' type should not be used on the published surface of a public type that is not '[WebHostHidden]'
Compiler warning (level 1) C4454 'function' is overloaded by more than the number of input parameters without having [DefaultOverload] specified. Picking 'declaration' as the default overload
Compiler warning (level 1) C4455 'operator operator': literal suffix identifiers that do not start with an underscore are reserved
Compiler warning (level 4) C4456 declaration of 'identifier' hides previous local declaration
Compiler warning (level 4) C4457 declaration of 'identifier' hides function parameter
Compiler warning (level 4) C4458 declaration of 'identifier' hides class member
Compiler warning (level 4) C4459 declaration of 'identifier' hides global declaration
Compiler warning (level 4) C4460 'WinRT|managed' operator 'operator', has parameter passed by reference. 'WinRT|managed' operator 'operator' has different semantics from C++ operator 'cpp_operator', did you intend to pass by value?
Compiler warning (level 1) C4461 'classname': this class has a finalizer '!finalizer' but no destructor '~dtor'
Compiler warning (level 1, Error) C4462 'type' : cannot determine the GUID of the type. Program may fail at runtime.
Compiler warning (level 4) C4463 overflow; assigning 'value' to bit-field that can only hold values from 'min_value' to 'max_value'
Compiler warning (level 4) C4464 relative include path contains '..'
Compiler warning C4466 Could not perform coroutine heap elision
Compiler warning (level 1) C4467 Usage of ATL attributes is deprecated
Compiler warning (level 1) C4468 The [[fallthrough]] attribute must be followed by a case label or a default label
Compiler warning (level 1) C4470 floating-point control pragmas ignored under /clr
Compiler warning (level 4) C4471 'enumeration': a forward declaration of an unscoped enumeration must have an underlying type (int assumed)
Compiler warning (level 1) C4472 'identifier' is a native enum: add an access specifier (private/public) to declare a 'WinRT|managed' enum
Compiler warning (level 1) C4473 'function' : not enough arguments passed for format string
Compiler warning (level 3) C4474 'function' : too many arguments passed for format string
Compiler warning (level 3) C4475 'function' : length modifier 'modifier' cannot be used with type field character 'character' in format specifier
Compiler warning (level 3) C4476 'function' : unknown type field character 'character' in format specifier
Compiler warning (level 1) C4477 'function' : format string 'string' requires an argument of type 'type', but variadic argument number has type 'type'
Compiler warning (level 1) C4478 'function' : positional and non-positional placeholders cannot be mixed in the same format string
Compiler warning (Error) C4480 nonstandard extension used: specifying underlying type for enum 'enumeration'
Compiler warning (level 4) C4481 nonstandard extension used: override specifier 'keyword'
Compiler warning C4482 nonstandard extension used: enum 'enumeration' used in qualified name
Compiler warning (level 1, Error) C4483 syntax error: expected C++ keyword
Compiler warning (Error) C4484 'override_function': matches base ref class method 'base_class_function', but is not marked 'virtual', 'new' or 'override'; 'new' (and not 'virtual') is assumed
Compiler warning (Error) C4485 'override_function': matches base ref class method 'base_class_function', but is not marked 'new' or 'override'; 'new' (and 'virtual') is assumed
Compiler warning (level 1) C4486 'function': a private virtual method of a ref class or value class should be marked 'sealed'
Compiler warning (level 4) C4487 'derived_class_function': matches inherited non-virtual method 'base_class_function' but is not explicitly marked 'new'
Compiler warning (level 1) C4488 'function': requires 'keyword' keyword to implement the interface method 'interface_method'
Compiler warning (level 1) C4489 'specifier': not allowed on interface method 'method'; override specifiers are only allowed on ref class and value class methods
Compiler warning (level 1) C4490 'override': incorrect use of override specifier; 'function' does not match a base ref class method
Compiler warning (level 1) C4491 'name': has an illegal IDL version format
Compiler warning (level 1, Error) C4492 'function1': matches base ref class method 'function2', but is not marked 'override'
Compiler warning (level 3, Error) C4493 delete expression has no effect as the destructor of 'type' does not have 'public' accessibility
Compiler warning (level 1) C4494 'function' : Ignoring __declspec(allocator) because the function return type is not a pointer or reference
Compiler warning C4495 nonstandard extension '__super' used: replace with explicit base class name
Compiler warning C4496 nonstandard extension 'for each' used: replace with ranged-for statement
Compiler warning C4497 nonstandard extension 'sealed' used: replace with 'final'
Compiler warning C4498 nonstandard extension used: 'extension'
Compiler warning (level 4) C4499 'function' : an explicit specialization cannot have a storage class (ignored)"
Compiler warning (level 1) C4502 'linkage specification' requires use of keyword 'extern' and must precede all other specifiers
Compiler warning (level 1) C4503 'identifier': decorated name length exceeded, name was truncated
Compiler warning (level 4) C4505 'function': unreferenced local function has been removed
Compiler warning (level 1) C4506 no definition for inline function 'function'
Compiler warning (level 1) C4508 'function': function should return a value; 'void' return type assumed
Compiler warning C4509 nonstandard extension used: 'function' uses SEH and 'object' has destructor
Compiler warning (level 4) C4510 'class': default constructor was implicitly defined as deleted
Compiler warning (level 3) C4511 'class': copy constructor was implicitly defined as deleted
Compiler warning (level 4) C4512 'class': assignment operator was implicitly defined as deleted
Compiler warning (level 4) C4513 'class': destructor was implicitly defined as deleted
Compiler warning (level 4) C4514 'function': unreferenced inline function has been removed
Compiler warning (level 4) C4515 'namespace': namespace uses itself
Compiler warning (level 4) C4516 'class::symbol': access-declarations are deprecated; member using-declarations provide a better alternative
Compiler warning (level 4) C4517 access-declarations are deprecated; member using-declarations provide a better alternative
Compiler warning (level 1) C4518 'specifier': storage-class or type specifier(s) unexpected here; ignored
Compiler warning (Error) C4519 default template arguments are only allowed on a class template
Compiler warning (level 3) C4521 'class': multiple copy constructors specified
Compiler warning (level 3) C4522 'class': multiple assignment operators specified
Compiler warning (level 3) C4523 'class': multiple destructors specified
Compiler warning (level 1) C4526 'function': static member function cannot override virtual function 'virtual function' override ignored, virtual function will be hidden
Compiler warning (level 1) C4530 C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Compiler warning (level 1) C4531 C++ exception handling not available on Windows CE. Use Structured Exception Handling
Compiler warning (level 1) C4532 'continue': jump out of '__finally/finally' block has undefined behavior during termination handling
Compiler warning (level 1) C4533 initialization of 'variable' is skipped by 'goto label'
Compiler warning (level 3) C4534 'constructor' will not be a default constructor for 'class/struct' 'identifier' due to the default argument
Compiler warning (level 3) C4535 calling _set_se_translator() requires /EHa
Compiler warning (level 4) C4536 'typename': type-name exceeds meta-data limit of 'character_limit' characters
Compiler warning (level 1) C4537 'object': '.' applied to non-UDT type
Compiler warning (level 3) C4538 'type': const/volatile qualifiers on this type are not supported
Compiler warning (level 1) C4540 dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')
Compiler warning (level 1) C4541 'identifier' used on polymorphic type 'type' with /GR-; unpredictable behavior may result
Compiler warning (level 1) C4542 Skipping generation of merged injected text file, cannot write filetype file: 'issue': message
Compiler warning (level 3) C4543 Injected text suppressed by attribute 'no_injected_text'
Compiler warning (level 1) C4544 'declaration': default template argument ignored on this template declaration
Compiler warning (level 1) C4545 expression before comma evaluates to a function which is missing an argument list
Compiler warning (level 1) C4546 function call before comma missing argument list
Compiler warning (level 1) C4547 'operator': operator before comma has no effect; expected operator with side-effect
Compiler warning (level 1) C4548 expression before comma has no effect; expected expression with side-effect
Compiler warning (level 1) C4549 'operator': operator before comma has no effect; did you intend 'operator'?
Compiler warning (level 1) C4550 expression evaluates to a function which is missing an argument list
Compiler warning (level 1) C4551 function call missing argument list
Compiler warning (level 1) C4552 'operator': operator has no effect; expected operator with side-effect
Compiler warning (level 1) C4553 'operator': operator has no effect; did you intend 'operator'?
Compiler warning (level 3) C4554 C4554 'operator': check operator precedence for possible error; use parentheses to clarify precedence
Compiler warning (level 1) C4555 expression has no effect; expected expression with side-effect
Compiler warning (level 1) C4556 value of intrinsic immediate argument 'value' is out of range 'lower_bound - upper_bound'
Compiler warning (level 3) C4557 '__assume' contains effect 'effect'
Compiler warning (level 1) C4558 value of operand 'value' is out of range 'lower_bound - upper_bound'
Compiler warning (level 4) C4559 'function': redefinition; the function gains __declspec(modifier)
Compiler warning (level 1) C4561 '__fastcall' incompatible with the '/clr' option: converting to '__stdcall'
Compiler warning (level 4) C4562 fully prototyped functions are required with the '/clr' option: converting '()' to '(void)'
Compiler warning (level 4) C4564 method 'method' of 'class' 'classname' defines unsupported default parameter 'parameter'
Compiler warning (level 4) C4565 'function': redefinition; the symbol was previously declared with __declspec(modifier)
Compiler warning (level 1) C4566 character represented by universal-character-name 'char' cannot be represented in the current code page (number)
Compiler warning (level 1) C4568 'function': no members match the signature of the explicit override
Compiler warning (level 3) C4569 'function': no members match the signature of the explicit override
Compiler warning (level 3) C4570 'type': is not explicitly declared as abstract but has abstract functions
Compiler warning (level 4) C4571 Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught
Compiler warning (level 1) C4572 [ParamArray] attribute is deprecated under /clr, use '...' instead
Compiler warning (level 1) C4573 the usage of 'lambda function' requires the compiler to capture 'this' but the current default capture mode does not allow it
Compiler warning (level 4) C4574 'Identifier' is defined to be '0': did you mean to use '#if identifier'?
Compiler warning (level 1) C4575 '__vectorcall' incompatible with the '/clr' option: converting to '__stdcall'
Compiler warning (level 1, Error) C4576 a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
Compiler warning (level 1, Off) C4577 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc
Compiler warning (level 1, Error) C4578 'abs': conversion from 'type1' to 'type2', possible loss of data (Did you mean to call 'function' or to #include <cmath>?)
Compiler warning (level 3) C4580 [attribute] is deprecated; instead specify System::Attribute or Platform::Metadata as a base class
Compiler warning (level 1) C4581 deprecated behavior: '"string"' replaced with 'string' to process attribute
Compiler warning (level 4) C4582 'type': constructor is not implicitly called
Compiler warning (level 4) C4583 'type': destructor is not implicitly called
Compiler warning (level 1) C4584 'class1': base-class 'class2' is already a base-class of 'class3'
Compiler warning (level 1, Error) C4585 'class': A WinRT 'public ref class' must either be sealed or derive from an existing unsealed class
Compiler warning (level 1, Error) C4586 'type': A public type cannot be declared in a top-level namespace called 'Windows'
Compiler warning (level 1) C4587 'anonymous_structure': behavior change: constructor is no longer implicitly called
Compiler warning (level 1) C4588 'anonymous_structure': behavior change: destructor is no longer implicitly called
Compiler warning (level 4) C4589 Constructor of abstract class 'class1' ignores initializer for virtual base class 'class2'
Compiler warning (level 1) C4591 'constexpr' call-depth limit of number exceeded (/constexpr:depth<NUMBER>)
Compiler warning (level 3) C4592 'function': 'constexpr' call evaluation failed; function will be called at run-time
Compiler warning (level 1) C4593 'function': 'constexpr' call evaluation step limit of 'limit' exceeded; use /constexpr:steps<NUMBER> to increase the limit
Compiler warning (level 3) C4594 'type': destructor will not be implicitly called if an exception is thrown
Compiler warning (level 1) C4595 'type': behavior change: destructor will no longer be implicitly called if an exception is thrown
Compiler warning (level 4) C4596 'identifier': illegal qualified name in member declaration
Compiler warning (error) C4597 undefined behavior: offsetof applied to a member of a virtual base
Compiler warning (level 1 and level 3) C4598 '#include "header"': header number number in the precompiled header does not match current compilation at that position
Compiler warning (level 3) C4599 'flag path': command line argument number number does not match precompiled header

See also

C/C++ Compiler and build tools errors and warnings
Compiler warnings C4000 - C5999