![]() |
![]() |
1333 | ![]() |
||||
![]() | |||||||
| Functions | |||||||
This function is being called without a previous prototype declaration. However, the number of arguments or the type of the arguments in the function call is different from those specified in the definition of the function encountered later. It is always advisable to use function prototypes consistently throughout your source code. Function prototypes are best located in header files and should always be positioned before any function calls. It can be dangerous to use them in some places but not in others. When functions are called in the absence of a prototype, arguments of type char, short and float are subject to default argument promotion. For example:
/*PRQA S 1302,2017,2110,2114,3199,3203,3227,3408,3447,3602 ++*/
void test(signed char a)
{
int r;
r = foo(a); /* Messages 1333 and 3335 */
}
extern int foo ( unsigned char a ) /* Message 0626 */
{
return (int)a;
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |