The sizeof operator used in a comparison does not generate C4018
Article ID: 117201
Article Last Modified on 7/5/2005
APPLIES TO
- Microsoft C Professional Development System 6.0a
- Microsoft Visual C++ 1.0 Professional Edition
- Microsoft Visual C++ 1.5 Professional Edition
- Microsoft Visual C++ 1.0 Professional Edition
- Microsoft Visual C++ 2.0 Professional Edition
- Microsoft Visual C++ 4.0 Standard Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Standard Edition
- Microsoft Visual C++ 6.0 Service Pack 5
- Microsoft Visual C++ .NET 2002 Standard Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
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
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Additional query words: kbVC400bug 6.00 6.00a 6.00ax 7.00 8.00 8.00c
9.00
Keywords: kbbug kbcompiler KB117201