![]() |
![]() |
0688 | ![]() |
||||
![]() | |||||||
| Declarations and definitions | REFERENCE - ISO:C90-6.5.7 Initialization - Semantics, ISO:C90 5.1.1.2 Translation Phase 6 | ||||||
An array is being defined and is being initialized using a brace-enclosed initializer containing string literals. The size of the array is not specified explicitly but will be defined by the number of initializers. Some of the string literals are not separated by commas. Is this intended ? Be aware that when adjacent string literals are not separated by commas, they are concatenated; so omitting a comma by mistake will have severe repercussions. For example:
/*PRQA S 753,2017,2213,3122,3132,3211,3408,3625 ++*/
char * pa1 = "aaabbb";
char * pa2 = "aaa" "bbb";
char * pb1[] = {"aaabbb", "cccddd"}; /* Message 3674 */
char * pb2[] = {"aaabbb" "cccddd"}; /* Message 3674 and 0688 */
char bufa1[] = "aaabbb"; /* Message 3674 */
char bufa2[] = "aaa" "bbb"; /* Message 3674 */
char bufb1[][20] = {"aaabbb", "cccddd"}; /* Message 3674 */
char bufb2[][20] = {"aaabbb" "cccddd"}; /* Message 3674 and 0688 */
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |