@@ -327,13 +327,28 @@ warn_for_int_to_enum_conversion (struct expression *expr, struct symbol *typeb)
}
static void
-warn_for_enum_conversions(struct expression *expr, struct symbol *type)
+do_warn_for_enum_conversions(struct expression *expr, struct symbol *type)
{
warn_for_different_enum_types (expr, type);
warn_for_enum_to_int_conversion (expr, type);
warn_for_int_to_enum_conversion (expr, type);
}
+static void
+warn_for_enum_conversions(struct expression *expr, struct symbol *type)
+{
+ switch (expr->type) {
+ case EXPR_CONDITIONAL:
+ case EXPR_SELECT:
+ do_warn_for_enum_conversions(expr->cond_true, type);
+ do_warn_for_enum_conversions(expr->cond_false, type);
+ break;
+
+ default:
+ do_warn_for_enum_conversions(expr, type);
+ }
+}
+
/*
* This gets called for implicit casts in assignments and
* integer promotion. We often want to try to move the