[previous] 0179 [next] [U] Argument type does not match conversion specifier number %s.
Explicitly undefined REFERENCE - ISO:C90-7.9.6.1 Formatted input/output functions

This format string includes a conversion specifier which is not consistent with the type of the corresponding argument in a call to printf, fprintf or sprintf.

For example, in the code below, an argument (n) of type int is not consistent with the conversion specifier "%f". "%f" is only appropriate for data of type float.


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

#include <stdio.h>

extern void foo(int n, unsigned char* s)
{
    printf("The total is %f", n);         /* Message 0179 */
    printf("In currency %s", s);          /* Message 0179 */
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents