Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The formatted output functions (fprintf() and related functions) convert, format, and print their arguments under control of a format string, defined by the C Standard, 7.21.6.1, paragraph 3 [ISO/IEC 9899:2011], specifies:

The format shall be a multibyte character sequence, beginning and ending in its initial shift state. The format is composed of zero or more directives: ordinary multibyte characters (not %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments, converting them, if applicable, according to the corresponding conversion specifier, and then writing the result to the output stream.

...

Tool

Version

Checker

Description

CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

IO.INJ.FMT
MISC.FMT

Format string injection
Format string

Coverity
Include Page
Coverity_V
Coverity_V
PW.PRINTF_ARG_MISMATCHReports when the number of arguments differs from the number of required arguments according to the format string

GCC

Include Page
GCC_V
GCC_V

 

Can detect violations of this recommendation when the -Wformat flag is used

Klocwork

Include Page
Klocwork_V
Klocwork_V

SV.FMT_STR

 

LDRA tool suite

Include Page
LDRA_V
LDRA_V

486 S
589 S

Fully implemented

Parasoft C/C++test9.5PB-45,PB-46,PB-47,PB-48,PB-49,PB-50Fully implemented
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v

0179 (U)
0180 (C99)
0184 (U)
0185 (U)
0190 (U)
0191 (U)
0192 (U)
0193 (U)
0194 (U)
0195 (U)
0196 (U)
0197 (U)
0198 (U)
0199 (U)
0200 (U)
0201 (U)
0202 (I)
0206 (U)

Partially implemented

...