static int rhs_current_operand_signedness_for_warning_now (void);
static void warn_signedness_comparison_values_now (int left_signedness, int right_signedness, const char *report_start, const char *report_caret);
+static int rhs_last_explicit_integer_cast_signedness = -1;
static int64_s parse_floating_const_expr_bits_now (int size);
static int initializer_contains_runtime_call_now (void) {
} else {
emit_apply_integer_cast_to_reg_now (reg, cast_base_size, cast_is_unsigned);
+
clear_rhs_last_pointer_info ();
+ rhs_last_explicit_integer_cast_signedness = cast_is_unsigned ? 1 : 0;
}
int case_count;
int default_label;
+
int break_label;
+ int break_seen;
};
sw.case_count = 0;
sw.default_label = -1;
+
sw.break_label = anon_label++;
+ sw.break_seen = 0;
get_token ();
expect (TOK_LPAREN, "(");
* is compiled without the jump over the else block and the true branch
* falls through into the else body.
*/
- (void)saved_ends_control_flow;
- statement_ends_control_flow = 0;
+ statement_ends_control_flow = sw.default_label >= 0 && !sw.break_seen && saved_ends_control_flow;
}
const char *rhs_report_start;
const char *rhs_report_caret;
+ rhs_last_explicit_integer_cast_signedness = -1;
+
lhs_signedness = rhs_current_operand_signedness_for_warning_now ();
is_unsigned = emit_load_assignment_binary_expression_prec_to_reg (reg, 1);
+ if (rhs_last_explicit_integer_cast_signedness >= 0) {
+ lhs_signedness = rhs_last_explicit_integer_cast_signedness;
+ }
+
lhs_pointer_depth = rhs_last_pointer_depth;
if (lhs_pointer_depth > 0) {
op = tok.kind;
get_token ();
+ rhs_last_explicit_integer_cast_signedness = -1;
rhs_signedness = rhs_current_operand_signedness_for_warning_now ();
rhs_report_start = tok.report_start;
rhs_signedness = -1;
} else if (postfix_member_seen) {
rhs_signedness = postfix_member_is_unsigned ? 1 : 0;
+ } else if (rhs_last_explicit_integer_cast_signedness >= 0) {
+ rhs_signedness = rhs_last_explicit_integer_cast_signedness;
}
}
if (target_label >= 0) {
+ if (current_switch_context && target_label == current_switch_context->break_label) {
+ current_switch_context->break_seen = 1;
+ }
+
cleanup_bytes = current_block_cleanup_bytes - cleanup_base;
if (!current_function_uses_single_frame && cleanup_bytes > 0) {
static int current_expression_mentions_64bit_symbol_now (void);
static int rhs_current_operand_is_unsigned_now (void);
+static int rhs_last_explicit_integer_cast_signedness = -1;
static int rhs_current_operand_signedness_for_warning_now (void);
static void warn_signedness_comparison_values_now (int left_signedness, int right_signedness, const char *report_start, const char *report_caret);
}
emit_apply_integer_cast_to_reg_now (reg, cast_base_size, cast_is_unsigned);
+
clear_rhs_last_pointer_info ();
+ rhs_last_explicit_integer_cast_signedness = cast_is_unsigned ? 1 : 0;
}
int case_count;
int default_label;
+
int break_label;
+ int break_seen;
};
sw.case_count = 0;
sw.default_label = -1;
+
sw.break_label = anon_label++;
+ sw.break_seen = 0;
get_token ();
expect (TOK_LPAREN, "(");
* is compiled without the jump over the else block and the true branch
* falls through into the else body.
*/
- (void)saved_ends_control_flow;
- statement_ends_control_flow = 0;
+ statement_ends_control_flow = sw.default_label >= 0 && !sw.break_seen && saved_ends_control_flow;
}
const char *rhs_report_start;
const char *rhs_report_caret;
+ rhs_last_explicit_integer_cast_signedness = -1;
+
lhs_signedness = rhs_current_operand_signedness_for_warning_now ();
is_unsigned = emit_load_assignment_binary_expression_prec_to_reg (reg, 1);
+ if (rhs_last_explicit_integer_cast_signedness >= 0) {
+ lhs_signedness = rhs_last_explicit_integer_cast_signedness;
+ }
+
lhs_pointer_depth = rhs_last_pointer_depth;
if (lhs_pointer_depth > 0) {
op = tok.kind;
get_token ();
+ rhs_last_explicit_integer_cast_signedness = -1;
rhs_signedness = rhs_current_operand_signedness_for_warning_now ();
rhs_report_start = tok.report_start;
rhs_signedness = -1;
} else if (postfix_member_seen) {
rhs_signedness = postfix_member_is_unsigned ? 1 : 0;
+ } else if (rhs_last_explicit_integer_cast_signedness >= 0) {
+ rhs_signedness = rhs_last_explicit_integer_cast_signedness;
}
}
if (target_label >= 0) {
+ if (current_switch_context && target_label == current_switch_context->break_label) {
+ current_switch_context->break_seen = 1;
+ }
+
cleanup_bytes = current_block_cleanup_bytes - cleanup_base;
if (!current_function_uses_single_frame && cleanup_bytes > 0) {