Compiler Warnings C4800 Through C4999

Visual Studio 2015
 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Warnings C4800 Through C4999.

The articles in this part of the documentation contain information about a subset of the Visual C++ compiler warnings. You can access the information here or, in the Output window in Visual Studio, you can select an error number and then press the F1 key.

WarningMessage
Compiler Warning (level 3) C4800'type': forcing value to bool 'true' or 'false' (performance warning)
Compiler Warning C4801Return by reference is not verifiable: %s
Compiler Warning (level 1) C4803'method': the raise method has a different storage class from that of the event, 'event'
Compiler Warning (level 1) C4804'operation': unsafe use of type 'bool' in operation
Compiler Warning (level 1) C4805'operation': unsafe mix of type 'type' and type 'type' in operation
Compiler warning (level 1) C4806'operation': unsafe operation: no value of type 'type' promoted to type 'type' can equal the given constant
Compiler warning (level 1) C4807'operation': unsafe mix of type 'type' and signed bit field of type 'type'
Compiler warning (level 1) C4808case 'value' is not a valid value for switch condition of type 'bool'
Compiler warning (level 1) C4809switch statement has redundant 'default' label; all possible 'case' labels are given
Compiler warning (level 1) C4810value of pragma pack(show) == n
Compiler warning (level 1) C4811value of pragma conform(forScope, show) == value
Compiler warning (level 1) C4812obsolete declaration style: please use 'new_syntax' instead
Compiler warning (level 1) C4813'function': a friend function of a local class must have been previously declared
Compiler Warning (level 4) C4815'var': zero-sized array in stack object will have no elements (unless the object is an aggregate that has been aggregate initialized)
Compiler warning (level 4) C4816'param': parameter has a zero-sized array which will be truncated (unless the object is passed by reference)
Compiler warning (level 1) C4817'member': illegal use of '.' to access this member; compiler replaced with '->'
Compiler Warning (level 1) C4819The file contains a character that cannot be represented in the current code page (number). Save the file in Unicode format to prevent data loss
Compiler Warning (level 4) C4820'bytes' bytes padding added after construct 'member_name'
Compiler Warning (level 1) C4821Unable to determine Unicode encoding type, please save the file with signature (BOM)
Compiler warning (level 1) C4822'member function': local class member function does not have a body
Compiler Warning (level 3) C4823'function': uses pinning pointers but unwind semantics are not enabled. Consider using /EHa
Compiler warning (level 4) C4825
Compiler Warning (level 2) C4826Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
Compiler warning (level 3) C4827A public 'ToString' method with 0 parameters should be marked as virtual and override
Compiler Warning (level 1) C4829Possibly incorrect parameters to function main. Consider 'int main(Platform::Array<Platform::String^>^ argv)'
Compiler Warning (level 1) C4835'variable': the initializer for exported data will not be run until managed code is first executed in the host assembly
Compiler warning (level 4) C4837trigraph detected: 'trigraph' replaced by 'character'
Compiler Warning (level 1) C4838conversion from 'type_1' to 'type_2' requires a narrowing conversion
Compiler Warning C4867'function': function call missing argument list; use 'call' to create a pointer to member
Compiler Warning C4868'file(line_number)' compiler may not enforce left-to-right evaluation order in braced initialization list
Compiler warning (level 2) C4872floating point division by zero detected when compiling the call graph for the concurrency::parallel_for_each at: '%s'
Compiler warning (level 1) C4880casting from 'const type_1' to 'type_2': casting away constness from a pointer or reference may result in undefined behavior in an amp restricted function
Compiler warning (level 4) C4881the constructor and/or the destructor will not be invoked for tile_static variable 'variable'
Compiler warning (level 1) C4882passing functors with non-const call operators to concurrency::parallel_for_each is deprecated
Compiler warning C4900Il mismatch between 'tool1' version 'version1' and 'tool2' version 'version2'
Compiler Warning (level 1) C4905wide string literal cast to 'LPSTR'
Compiler Warning (level 1) C4906string literal cast to 'LPWSTR'
Compiler warning (level 1) C4910'<identifier>: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
Compiler warning (level 1) C4912'attribute': attribute has undefined behavior on a nested UDT
Compiler warning (level 4) C4913user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used
Compiler warning (level 1) C4916in order to have a dispid, '%$S': must be introduced by an interface
Compiler Warning (level 1) C4917'declarator': a GUID can only be associated with a class, interface or namespace
Compiler warning (level 4) C4918'character': invalid character in pragma optimization list
Compiler warning (level 1) C4920enum enum member member_1=value_1 already seen in enum enum as member_2=value_2
Compiler warning (level 3) C4921'%s': attribute value '%s' should not be multiply specified
Compiler warning (level 1) C4925'method': dispinterface method cannot be called from script
Compiler warning (level 1) C4926'identifier': symbol is already defined: attributes ignored
Compiler Warning (level 1) C4927illegal conversion; more than one user-defined conversion has been implicitly applied
Compiler Warning (level 1) C4928illegal copy-initialization; more than one user-defined conversion has been implicitly applied
Compiler Warning (level 1) C4929'file': typelibrary contains a union; ignoring the 'embedded_idl' qualifier
Compiler Warning (level 1) C4930'prototype': prototyped function not called (was a variable definition intended?)
Compiler Warning (level 4) C4931we are assuming the type library was built for number-bit pointers
Compiler warning (level 4) C4932__identifier(identifier) and __identifier(identifier) are indistinguishable
Compiler warning (level 1) C4934'__delegate(multicast)' is deprecated, use '__delegate' instead
Compiler warning (level 1) C4935assembly access specifier modified from 'access'
Compiler warning (level 1) C4936this __declspec is supported only when compiled with /clr or /clr:pure
Compiler warning (level 4) C4937'text1' and 'text2' are indistinguishable as arguments to 'directive'
Compiler warning (level 4) C4938'var': Floating point reduction variable may cause inconsistent results under /fp:strict or #pragma fenv_access
Compiler warning C4939#pragma vtordisp is deprecated and will be removed in a future release of Visual C++
Compiler warning (level 1) C4944'symbol': cannot import symbol from 'assembly1': as 'symbol' already exists in the current scope
Compiler Warning (level 1) C4945'symbol': cannot import symbol from 'assembly1': as 'symbol' has already been imported from another assembly 'assembly2'
Compiler Warning (level 1) C4946reinterpret_cast used between related classes: 'class1' and 'class2'
Compiler warning (level 1) C4947'type_or_member': marked as obsolete
Compiler Warning (level 2) C4948return type of 'accessor' does not match the last parameter type of the corresponding setter
Compiler Warning (level 1 and level 4) C4949pragmas 'managed' and 'unmanaged' are meaningful only when compiled with '/clr[:option]'
Compiler warning (level 1) C4950'type_or_member': marked as obsolete
Compiler warning C4951'function' has been edited since profile data was collected, function profile data not used
Compiler warning C4952'function': no profile data found in program database 'pgd_file'
Compiler warning C4953Inline 'function' has been edited since profile data was collected, profile data not used
Compiler warning C4954'function': not profiled (contains __int64 switch expression)
Compiler warning C4955'import2': import ignored; already imported from 'import1'
Compiler warning (level 1) C4956'type': this type is not verifiable
Compiler warning (level 1) C4957'cast': explicit cast from 'cast from' to 'cast_to' is not verifiable
Compiler warning (level 1) C4958'operation': pointer arithmetic is not verifiable
Compiler warning (level 1) C4959cannot define unmanaged type 'type' in /clr:safe because accessing its members yields unverifiable code
Compiler warning C4960'function' is too big to be profiled
Compiler warning C4961No profile data was merged into '.pgd file', profile-guided optimizations disabled
Compiler warning C4962'function': Profile-guided optimizations disabled because optimizations caused profile data to become inconsistent
Compiler warning C4963%s': no profile data found; different compiler options were used in instrumented build
Compiler Warning (level 1) C4964No optimization options were specified; profile info will not be collected
Compiler Warning (level 1) C4965implicit box of integer 0; use nullptr or explicit cast
Compiler warning C4966'%s' has __code_seg annotation with unsupported segment name, annotation ignored
Compiler warning C4970delegate constructor: target object ignored since '%$pS' is static
Compiler warning (level 1) C4971Argument order: <target object>, <target function> for delegate constructor is deprecated, use <target function>, <target object="">
Compiler warning (level 1) C4972Directly modifying or treating the result of an unbox operation as an lvalue is unverifiable
Compiler warning C4973'%$S': marked as deprecated
Compiler warning C4974'%$S': marked as deprecated
Compiler warning C4981Warbird: function '%$pD' marked as __forceinline not inlined because it contains exception semantics
Compiler warning (level 3) C4985symbol name': attributes not present on previous declaration.
Compiler Warning C4986'%$pS': exception specification does not match previous declaration
Compiler warning (level 4) C4987nonstandard extension used: 'throw (...)'
Compiler warning (level 4) C4988'%$S': variable declared outside class/function scope
Compiler warning C4989'%s': type has conflicting definitions.
Compiler warning C4990Warbird: %s
Compiler warning C4991Warbird: function '%$pD' marked as __forceinline not inlined because protection level of inlinee is greater than the parent
Compiler warning C4992Warbird: function '%$pD' marked as __forceinline not inlined because it contains inline assembly which cannot be protected
Compiler Warning (level 3) C4995'function': name was marked as #pragma deprecated
Compiler Warning (level 3) C4996'%$pS': %$*
Compiler warning (level 1) C4997'class': coclass does not implement a COM interface or pseudo-interface
Compiler warning (level 1) C4998EXPECTATION FAILED: %s(%d)
Compiler warning C4999UNKNOWN WARNING %$N Please choose the Technical Support command on the Visual C++ %$N Help menu, or open the Technical Support help file for more information
Show: