[previous] 0201 [next] [U] Incomplete conversion specifier, number %s.
Explicitly undefined REFERENCE - ISO:C90-7.9.6.2 Formatted input/output functions

An incomplete format conversion specifier has been encountered in a call to scanf, fscanf or sscanf. The character that specifies the type of conversion appears to be missing.

For example:


/*PRQA S 336,602,1302,1307,2017,3122,3132,3200,3209,3335,3408,3602,3625 ++*/

#include <stdio.h>

extern void foo(void)
{
    int n;

    scanf("%d",  &n);                      /*              */
    scanf("%5d", &n);                      /*              */

    scanf("%5",  &n);                      /* Message 0201 */
    scanf("%5h",  &n);                     /* Message 0201 */
    scanf("%L",  &n);                      /* Message 0201 */
}


MISRA C:2012 Rules applicable to message 0201:

Rule-1.3  (Required) There shall be no occurrence of undefined or critical unspecified behaviour


See also:

QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents