[previous] 0942 [next] [U] A * can only be used to specify array size within function prototype scope.
Explicitly undefined REFERENCE - ISO:C99-6.7.5.3 Function Declarators - Semantics

A '*' has been used in declaring the size of a variable length array. This syntax can be used in the declaration of a function but not in the definition of a function.

For example:


/*PRQA S 1052,2017,3205,3206,3221,3447 ++*/

extern void f1(int n, int ia[*]);        /* OK */
extern void f2(int n, int ib[*]);        /* OK */
extern void f3(int n, int ic[n]);

extern void f1(int n, int ia[*])         /* Message 0942 */
{
    extern void f3(int n, int ic[*]);    /* OK */
}

extern void f2(int n, int ib[n])
{
}

extern void f3(int n, int ic[n])
{
}

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