[previous] 0687 [next] Array has been initialized using concatenated strings and has fewer initializers than its declared size.
Declarations and definitions REFERENCE - ISO:C90-6.5.7 Initialization - Semantics

An array has been initialized with some string literals, but the number of initializers is less than the number of elements in the array. However some of the string literals are not separated by commas and so they have been concatenated. If this is intentional, it would be better practice to explicitly initialize the remaining array elements to avoid any uncertainty. If the remaining elements are not explicitly initialized, they will be implicitly initialized as null pointers or as empty strings, depending on the type of array. For example:


/*PRQA S 753,2017,3122,3132,3211,3408,3625 ++*/

char *lights [ 3 ] =
{
    "red"
    "blue",
    "green"
};                             /* Message 0687 */

char season [ 4 ] [ 20 ] =
{
    "winter",
    "spring"
    "summer",
    "autumn"
};                             /* Message 0687 */

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