From: Christoph Mallon Date: Mon, 27 Oct 2008 11:00:18 +0000 (+0000) Subject: C++ does not allow assignment from a void pointer type to a non-void pointer type. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=125b69bea51d05efd62599033e06ae4c035dcb64;p=cparser C++ does not allow assignment from a void pointer type to a non-void pointer type. [r23223] --- diff --git a/parser.c b/parser.c index 6fb2c81..a9752ba 100644 --- a/parser.c +++ b/parser.c @@ -1123,9 +1123,12 @@ static assign_error_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)) { + if (is_type_atomic(points_to_left, ATOMIC_TYPE_VOID)) return res; + + if (is_type_atomic(points_to_right, ATOMIC_TYPE_VOID)) { + /* ISO/IEC 14882:1998(E) §C.3.5:6 */ + return c_mode & _CXX ? ASSIGN_ERROR_INCOMPATIBLE : res; } if (!types_compatible(points_to_left, points_to_right)) {