[hackers] [scc] Do not generate errors in empty va_lists || Roberto E. Vargas Caballero
commit c54b187844de0922dc90e31e4932cbedf4c56e59
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Sep 26 13:54:11 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
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
_AT_@ -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
_AT_@ -2,7 +2,7 @@
name: TEST001
description: Basic hello world test
output:
-F3 P
+F3 P E
X4 F3 printf
F5
G6 F5 main
_AT_@ -13,7 +13,7 @@ G6 F5 main
}
*/
-int printf(char *fmt);
+int printf(char *fmt, ...);
int
main(void)
Received on Sat Sep 26 2015 - 14:29:10 CEST
This archive was generated by hypermail 2.3.0
: Sat Sep 26 2015 - 14:36:10 CEST