![]() |
![]() |
0699 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C90-6.5.7 Initialization - Semantics, ISO:C90-6.3.16.1 Simple Assignment - Constraints | ||||||
This is a constraint error A string literal or a wide string literal is being used to initialize a pointer of incompatible type. A string.literal is a constant of type 'array of char'. It can only be used to initialize an object of type "pointer to char" or "pointer to void", or an array of type char. A wide string literal is a constant of type 'array of wchar_t'. It can only be used to initialize an object of type "pointer to wchar_t" or "pointer to void", or an array of type wchar_t. For example:
/*PRQA S 878,2017,3122,3205,3408 ++*/
extern void foo(void)
{
long * p1 = "abc"; /* Message 0699 */
short * p2 = L"abc"; /* Message 0699 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |