From 8c61b999e9291a7a30df929a2b8e0f829deaf10a Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 13 Sep 2008 10:26:59 +0000 Subject: [PATCH] Prevent null pointer access, when printing error about parameter of incomplete type, if the parameter has no name. [r21924] --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index e9dd619..315d17c 100644 --- a/parser.c +++ b/parser.c @@ -3579,7 +3579,7 @@ static void semantic_parameter(declaration_t *declaration) declaration->type = type; if (is_type_incomplete(skip_typeref(type))) { - errorf(pos, "incomplete type '%T' not allowed for parameter '%Y'", + errorf(pos, "parameter '%#T' is of incomplete type", orig_type, declaration->symbol); } } @@ -4426,7 +4426,7 @@ static void parse_init_declarator_rest(declaration_t *declaration) if (is_type_function(type)) { errorf(&declaration->source_position, - "function %#T is initialized like a variable", + "function '%#T' is initialized like a variable", orig_type, declaration->symbol); orig_type = type_error_type; } -- 2.20.1