Compiler Warning C0354

Message: Comparison of one enumeration type (<type name 1>) with another (<type name 2>)

Possible error cause: Enumeration types are used in comparison operators.

Error correction:

Example of the warning:

{attribute 'qualified_only'}
{attribute 'strict'}
TYPE ENUM1:
(
      enum_member1 := 0,
      enum_member2 := 1
);
END_TYPE

{attribute 'qualified_only'}
{attribute 'strict'}
TYPE ENUM2:
(
      enum_member := 0
);
END_TYPE

PROGRAM MAIN
VAR
      enum1 : ENUM1;
      enum2 : ENUM2;
      i:INT;
END_VAR
enum1 := 0;
enum2 := 0;
IF enum1 > enum2 THEN
      i := 1;
END_IF;

The IF statement produces the following warning.

Message:

C0354: Comparison of one enumeration type (ENUM1) with another (ENUM2)