![]() |
![]() |
1308 | ![]() |
||||
![]() | |||||||
| C++ compatibility | |||||||
A tag is being defined for a struct, union or enum but it is also the name of a typedef. In C++ a tag is treated as a type name and this would not be allowed. For example:
/*PRQA S 553,750,780,782,2211,2213,2216,3205,3602++*/
typedef int A;
union A { int x; long y; }; /* warning 1308 */
typedef int B;
struct B { int x; long y; }; /* warning 1308 */
typedef int C;
enum C {C1, C2, C3}; /* warning 1308 */
union D { int x; long y; };
typedef int D; /* warning 1309 */
struct E { int x; long y; };
typedef int E; /* warning 1309 */
enum F {F1, F2, F3};
typedef int F; /* warning 1309 */
typedef union G { int x; long y; } G; /* Message 1310 */
typedef struct H { int x; long y; } H; /* Message 1310 */
typedef enum I { I1, I2, I3 } I; /* Message 1310 */
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |