From f88017a35b44823c9c8139796368d77c0ed11b4d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 3 Jun 2009 10:19:58 +0000 Subject: [PATCH] If a K&R function definition has a variadic prototype earlier, then make the function definition variadic, too. [r26095] --- parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.c b/parser.c index 008d118..d05ec2a 100644 --- a/parser.c +++ b/parser.c @@ -4811,6 +4811,10 @@ decl_list_end: if (proto_type != NULL) { type_t *proto_type_type = proto_type->declaration.type; proto_parameter = proto_type_type->function.parameters; + /* If a K&R function definition has a variadic prototype earlier, then + * make the function definition variadic, too. This should conform to + * §6.7.5.3:15 and §6.9.1:8. */ + new_type->function.variadic = proto_type_type->function.variadic; } else { /* §6.9.1.7: A K&R style parameter list does NOT act as a function * prototype */ -- 2.20.1