[previous] 0690 [next] [C] String literal contains too many characters to initialize object.
Constraint violations REFERENCE - ISO:C90-6.5.7 Initialization - Constraints, Semantics

This is a constraint error

An array is being initialised with a string literal which contains too many characters. For example:


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

char buf1[ ] = "Hello";     /* OK */
char buf2[6] = "Hello";     /* OK */
char buf3[4] = "Hello";     /* Message 0690 */


MISRA C:2012 Rules applicable to message 0690:

Rule-1.1  (Required) The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits


See also:

QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents