[previous] 3684 [next] Array declared with unknown size.
Arrays, structures, unions and bit-fields

An array has been declared with incomplete type.

This is only allowed when the array has external linkage. Some coding standards deprecate this practice because it prevents tools from checking the validity of array subscript operations.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 3684, 2840 --*/

extern int xa[10];
extern int xb[];                /* Message 3684 */

extern void foo(void)
{
    xa[10] = 0;                 /* Message 2840 - out of bounds */

    xb[10] = 0;                 /* No message - array size is unknown */
}

See also:

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