commit c54b187844de0922dc90e31e4932cbedf4c56e59
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Sat Sep 26 13:54:11 2015 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Sat Sep 26 13:54:11 2015 +0200
Do not generate errors in empty va_lists
This commits also introduces the correct prototype of printf
diff --git a/cc1/expr.c b/cc1/expr.c
index 03490ae..22613bd 100644
--- 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
index 64d17ad..12b46cd 100644
--- 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)