From: Christoph Mallon Date: Mon, 17 Dec 2007 18:38:49 +0000 (+0000) Subject: Only warn when pointer types are incompatible in assignment and do not generate an... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=4a9402a045bab128824e1191b78303174c08ed20;p=cparser Only warn when pointer types are incompatible in assignment and do not generate an error. [r18788] --- diff --git a/parser.c b/parser.c index c4b9187..d1221c6 100644 --- a/parser.c +++ b/parser.c @@ -744,10 +744,15 @@ static type_t *semantic_assign(type_t *orig_type_left, points_to_left = get_unqualified_type(points_to_left); points_to_right = get_unqualified_type(points_to_right); - if(!is_type_atomic(points_to_left, ATOMIC_TYPE_VOID) - && !is_type_atomic(points_to_right, ATOMIC_TYPE_VOID) - && !types_compatible(points_to_left, points_to_right)) { - return NULL; + if (is_type_atomic(points_to_left, ATOMIC_TYPE_VOID) || + is_type_atomic(points_to_right, ATOMIC_TYPE_VOID)) { + return orig_type_left; + } + + if (!types_compatible(points_to_left, points_to_right)) { + warningf(right->base.source_position, + "destination type '%T' in %s is incompatible with '%E' of type '%T'", + orig_type_left, context, right, orig_type_right); } return orig_type_left;