![]() |
![]() |
3003 | ![]() |
||||
![]() | |||||||
| Pointers | |||||||
A null character constant ('\0') is being assigned to a pointer. This is probably a mistake. Perhaps the intention was to assign a null pointer constant. If so, the mistake is harmless but confusing. A null character is simply a constant of type int and it will be implicitly converted to a null pointer constant. For example:
/*PRQA S 2017,3211,3408,3625 ++*/
#define NULL (void *)0
char *p = NULL; /* OK */
char *q = 0; /* OK */
char *r = '\0'; /* Message 3003 */
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |