![]() |
![]() |
1306 | ![]() |
||||
![]() | |||||||
| C++ compatibility | |||||||
This tentative definition follows an earlier tentative definition of the same object. A tentative definition of an object in C consists of a file scope declaration without an initializer and without the storage-class specifier extern. If it is followed by another tentative definition or a definition which does have an explicit initializer, it is treated simply as a declaration; otherwise it is treated as a definition with an implicit initializer of 0. Tentative definitions do not exist in C++; they are always treated as definitions. If a translation unit contains more than one tentative definition or a tentative definition followed by an explicit definition, C++ will consider the second one to be a duplicate definition - which is not allowed. For example:
/*PRQA S 3207,3211,3408,3447 ++*/
int a;
int a; /* Message 1306 */
static short b;
static short b; /* Message 1306 */
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |