[previous] 1309 [next] The typedef '%s' would clash with an existing 'struct' / 'union' / 'enum' tag in C++.
C++ compatibility

A typedef is being defined which is also the name of a tag for a struct, union or enum. 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 */

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents