Compartilhar via


PREfast Warning 273 (Windows CE 5.0)

Send Feedback

273 - Format string mismatch.
Additional Information: Non-integer passed as parameter <number> when integer is required in call to <function>.

This warning indicates that the format string specifies that an int is required (for example, a %d, length or precedence specification for printf) but a noninteger such as a float, string, or struct is being passed.

This defect can result in incorrect output. It can also cause a 64-bit porting problem.

This warning is often reported because of subtle errors in format strings, such as extra embedded spaces or unescaped percent signs.

If the warning appears to be incorrect, double-check your format string.

PREfast interprets format strings based on the implementations in the C run-time library that is included with Visual C++ .NET 2002.

Example

Defective Source

char buff[50];

sprintf(buff,
        "%*.*s",
        f,
        1,
        "cool");

Corrected Source

char buff[50];

sprintf(buff,
        "%*.*s",
        (int)f,
        1,
        "cool");

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.