다음을 통해 공유


PREfast Warning 274 (Windows CE 5.0)

Send Feedback

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

This warning indicates that the format string specifies that a character is required (for example, a %c or %C specification) but a noninteger such as a float, string, or struct is being passed.

This defect can result in incorrect output.

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[5];

sprintf(buff,
        "%c",
        str);

Corrected Source

char buff[5];

sprintf(buff,
        "%c",
        str[0]);

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.