aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xlint/lint1/msg_384.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/xlint/lint1/msg_384.c')
-rw-r--r--usr.bin/xlint/lint1/msg_384.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/usr.bin/xlint/lint1/msg_384.c b/usr.bin/xlint/lint1/msg_384.c
new file mode 100644
index 000000000000..9c7d21377c26
--- /dev/null
+++ b/usr.bin/xlint/lint1/msg_384.c
@@ -0,0 +1,26 @@
+/* $NetBSD: msg_384.c,v 1.2 2025/01/03 03:14:47 rillig Exp $ */
+# 3 "msg_384.c"
+
+// Test for message: function definition for '%s' with identifier list is obsolete in C23 [384]
+
+/* lint1-extra-flags: -X 351 */
+
+/*
+ * In traditional C, defining a function by listing its parameter names first,
+ * followed by declarations, was usual. This practice has been obsoleted in
+ * favor of defining the parameter types right in the declarator.
+ */
+
+static inline int
+/* expect+1: warning: function definition for 'function_with_identifier_list' with identifier list is obsolete in C23 [384] */
+function_with_identifier_list(a, b)
+ int a, b;
+{
+ return a + b;
+}
+
+static inline int
+function_with_prototype(int a, int b)
+{
+ return a + b;
+}