Article ID: 117201 - Last Review: July 5, 2005 - Revision: 4.1 The sizeof operator used in a comparison does not generate C4018This article was previously published under Q117201 On This PageSYMPTOMS 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. MORE INFORMATION The following sample code can be used to demonstrate the
problem. The C4018 warning is produced for the statement in function3, but not
for the statements in function1 and function2. Sample codeAPPLIES TO
| Article Translations
|
Back to the top
