The information in this article applies to:
SYMPTOMSWhen building a project that uses "constants" defined for Microsoft Cluster Server, the compiler might report a signed or unsigned mismatch warning. CAUSEThe values are defined in clusapi.h using enum instead of #define. Enum values are of type int, but the values are most often used as DWORD (unsigned long) parameters. If the high bit of the value is set, the compiler generates a warning. RESOLUTIONThe values can be cast to a DWORD before assigning them to, or using them as, a DWORD. For example:
STATUSThis behavior is by design. MORE INFORMATION
When the high bit of one value of an enum is set, the compiler considers
the value to be negative. When the value is assigned to an unsigned
variable, the compiler warns that some information (the "negativeness") is
lost in the assignment.
Additional query words:
Keywords : |
Last Reviewed: January 13, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |