commit c54b187844de0922dc90e31e4932cbedf4c56e59
parent b9081437c83b589ac0618b12c555bdbc9897279f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 26 Sep 2015 13:54:11 +0200
Do not generate errors in empty va_lists
This commits also introduces the correct prototype of printf
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cc1/expr.c b/cc1/expr.c
@@ -587,7 +587,7 @@ arguments(Node *np)
} while (accept(','));
no_pars:
- if (n > 0)
+ if (n > 0 && *targs != ellipsistype)
errorp("too few arguments in function call");
expect(')');
diff --git a/cc1/tests/test001.c b/cc1/tests/test001.c
@@ -2,7 +2,7 @@
name: TEST001
description: Basic hello world test
output:
-F3 P
+F3 P E
X4 F3 printf
F5
G6 F5 main
@@ -13,7 +13,7 @@ G6 F5 main
}
*/
-int printf(char *fmt);
+int printf(char *fmt, ...);
int
main(void)