[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:24:42 +0100 (CET)

commit 9c417171111b4aad76a9daee0ba019935d9ca0e1
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:23:45 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);
+}
Received on Thu Mar 09 2017 - 08:24:42 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 09 2017 - 08:36:27 CET