The information in this article applies to:
SYMPTOMS
Using the Microsoft C/C++ compiler (CL.EXE) versions 7.0, 8.0, and 8.0c for
MS-DOS, the following warning is generated:
Using the Microsoft C/C++ compiler (CL.EXE) versions 8.0 and 9.0 (32-bit edition), the following warning is generated:
Using the Microsoft C/C++ compiler (CL.EXE) version 10.0 and higher (32-bit edition), the following warning is generated:
CAUSEThese warnings are expected behavior. According to ANSI standards, variables of type int* are different from variables of type short*. And, although the compiler may be able to perform an implicit promotion/demotion among intergral types (char, short, int, long, etc.), pointers are not of integral type. RESOLUTIONTo remove these warnings, use an appropriate cast to instruct the compiler to explicitly convert the value from its current data type to the desired. MORE INFORMATION
The only restriction on the size of the short given by the ANSI standard is
that it NOT be longer than an integer. Code should be written with this in
mind so that it will be portable. In many implementations, such as WINDOWS
NT, integers are not the same as shorts.
Sample Code
Additional query words: 8.00 8.00c 9.00
Keywords : kbVC100 kbVC150 kbVC200 kbVC400 kbVC500 kbVC600 |
Last Reviewed: July 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |