[hackers] [scc] [tests] Add tests for k&r functions with default int || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 9 Mar 2017 08:49:17 +0100 (CET)

commit 6572e37a3b1e74f494411b50bcc4f91a150c9d87
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Mar 9 08:23:45 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Mar 9 08:49:13 2017 +0100

    [tests] Add tests for k&r functions with default int

diff --git a/tests/error/0019-kr_names.c b/tests/error/0019-kr_names.c
new file mode 100644
index 0000000..f6c0f03
--- /dev/null
+++ b/tests/error/0019-kr_names.c
_AT_@ -0,0 +1,21 @@
+/*
+PATTERN:
+0019-kr_names.c:9: warning: parameter names (without types) in function declaration
+0019-kr_names.c:13: warning: type of 'a' defaults to int
+0019-kr_names.c:13: warning: type of 'c' defaults to int
+.
+*/
+
+int f(a,b);
+
+int
+f(a,b,c) char b;
+{
+ return a - c + b;
+}
+
+int
+main(void)
+{
+ return f(1,0,1);
+}
diff --git a/tests/execute/0128-kr_names.c b/tests/execute/0128-kr_names.c
new file mode 100644
index 0000000..1001528
--- /dev/null
+++ b/tests/execute/0128-kr_names.c
_AT_@ -0,0 +1,13 @@
+int f(a,b);
+
+int
+f(a,b,c) char b;
+{
+ return a - c + b;
+}
+
+int
+main(void)
+{
+ return f(1,0,1);
+}
diff --git a/tests/execute/scc-tests.lst b/tests/execute/scc-tests.lst
index cb6e93c..798191d 100644
--- a/tests/execute/scc-tests.lst
+++ b/tests/execute/scc-tests.lst
_AT_@ -118,3 +118,4 @@
 0125-fundcl.c
 0126-macropar.c [TODO]
 0127-doublecte.c [TODO]
+0128-kr_names.c
Received on Thu Mar 09 2017 - 08:49:17 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 09 2017 - 09:00:21 CET