The sizeof operator used in a comparison does not generate C4018 (117201)
The information in this article applies to:
- Microsoft C for MS-DOS
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.2
- Microsoft Visual C++, 32-bit Editions 5.0
- Microsoft Visual C++, 32-bit Editions 6.0
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q117201 SYMPTOMS According to ANSI specifications, the sizeof operator returns
the unsigned integer size of a particular data type or variable.
When the sizeof operator is used in a comparison with an integer variable, the
compiler should, but does not, generate the following warning:
warning C4018: 'op' : signed/unsigned mismatch
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbCompiler KB117201 |
---|
|