![]() |
![]() |
0179 | ![]() |
||||
![]() | |||||||
| 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 */
}
MISRA C:2012 Rules applicable to message 0179:
| 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 |