shithub: scc

Download patch

ref: c54b187844de0922dc90e31e4932cbedf4c56e59
parent: b9081437c83b589ac0618b12c555bdbc9897279f
author: Roberto E. Vargas Caballero <[email protected]>
date: Sat Sep 26 09:54:11 EDT 2015

Do not generate errors in empty va_lists

This commits also introduces the correct prototype of printf

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -587,7 +587,7 @@
 	} while (accept(','));
 
 no_pars:
-	if (n > 0)
+	if (n > 0 && *targs != ellipsistype)
 		errorp("too few arguments in function call");
 
 	expect(')');
--- 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 @@
 }
 */
 
-int printf(char *fmt);
+int printf(char *fmt, ...);
 
 int
 main(void)