If a K&R function definition has a variadic prototype earlier, then make the function...
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 3 Jun 2009 10:19:58 +0000 (10:19 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 3 Jun 2009 10:19:58 +0000 (10:19 +0000)
[r26095]

parser.c

index 008d118..d05ec2a 100644 (file)
--- 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 */