From: Christoph Mallon Date: Tue, 21 Jun 2011 12:20:27 +0000 (+0200) Subject: Reduce code duplication. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=690cdfc552f528357e7656d97810b5e409739523;p=cparser Reduce code duplication. The duplicate contained a bug, of course: The shown position was wrong. --- diff --git a/parser.c b/parser.c index ef08abd..8edfee5 100644 --- a/parser.c +++ b/parser.c @@ -7665,13 +7665,10 @@ end_error:; } result_type = pointer_type; } else { - if (is_type_valid(other_type)) { - type_error_incompatible("while parsing conditional", - &expression->base.source_position, true_type, false_type); - } - result_type = type_error_type; + goto types_incompatible; } } else { +types_incompatible: if (is_type_valid(true_type) && is_type_valid(false_type)) { type_error_incompatible("while parsing conditional", &conditional->base.source_position, true_type,