Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: clean up wording in diagnostics



details:   https://anonhg.NetBSD.org/src/rev/930e24c5d145
branches:  trunk
changeset: 377371:930e24c5d145
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 09 11:18:55 2023 +0000

description:
lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.

diffstat:

 tests/usr.bin/xlint/lint1/c11_generic_expression.c     |   8 ++++----
 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c          |   8 ++++----
 tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c |   8 ++++----
 tests/usr.bin/xlint/lint1/d_fold_test.c                |  14 +++++++-------
 tests/usr.bin/xlint/lint1/decl_arg.c                   |  12 ++++++------
 tests/usr.bin/xlint/lint1/expr_sizeof.c                |   4 ++--
 tests/usr.bin/xlint/lint1/msg_019.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_050.c                    |   8 ++++----
 tests/usr.bin/xlint/lint1/msg_051.c                    |   8 ++++----
 tests/usr.bin/xlint/lint1/msg_057.c                    |   8 ++++----
 tests/usr.bin/xlint/lint1/msg_097.c                    |  12 ++++++------
 tests/usr.bin/xlint/lint1/msg_098.c                    |  10 +++++-----
 tests/usr.bin/xlint/lint1/msg_170.c                    |   8 ++++----
 tests/usr.bin/xlint/lint1/msg_183.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_192.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_204.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_213.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_231.c                    |   6 +++---
 tests/usr.bin/xlint/lint1/msg_240.c                    |   8 ++++----
 tests/usr.bin/xlint/lint1/msg_269.c                    |   6 +++---
 tests/usr.bin/xlint/lint1/msg_280.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_293.c                    |   4 ++--
 tests/usr.bin/xlint/lint1/msg_310.c                    |   4 ++--
 usr.bin/xlint/lint1/decl.c                             |  10 +++++-----
 usr.bin/xlint/lint1/err.c                              |  16 ++++++++--------
 usr.bin/xlint/lint1/lex.c                              |   8 ++++----
 usr.bin/xlint/lint1/tree.c                             |   6 +++---
 27 files changed, 100 insertions(+), 100 deletions(-)

diffs (truncated from 716 to 300 lines):

diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/c11_generic_expression.c
--- a/tests/usr.bin/xlint/lint1/c11_generic_expression.c        Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/c11_generic_expression.c        Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c11_generic_expression.c,v 1.17 2023/07/07 19:45:22 rillig Exp $       */
+/*     $NetBSD: c11_generic_expression.c,v 1.18 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "c11_generic_expression.c"
 
 /* lint1-extra-flags: -X 351 */
@@ -22,7 +22,7 @@
 const char *
 classify_type_without_default(double var)
 {
-       /* expect-2: warning: argument 'var' unused in function 'classify_type_without_default' [231] */
+       /* expect-2: warning: parameter 'var' unused in function 'classify_type_without_default' [231] */
 
        return _Generic(var,
            long double: "long double",
@@ -38,7 +38,7 @@ classify_type_without_default(double var
 const char *
 classify_type_with_default(double var)
 {
-       /* expect-2: warning: argument 'var' unused in function 'classify_type_with_default' [231] */
+       /* expect-2: warning: parameter 'var' unused in function 'classify_type_with_default' [231] */
 
        return _Generic(var,
            long double: "long double",
@@ -54,7 +54,7 @@ classify_type_with_default(double var)
 const char *
 classify_char(char c)
 {
-       /* expect-2: warning: argument 'c' unused in function 'classify_char' [231] */
+       /* expect-2: warning: parameter 'c' unused in function 'classify_char' [231] */
 
        return _Generic(c,
            char: "yes",
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_bool_strict.c,v 1.42 2023/07/09 10:42:07 rillig Exp $    */
+/*     $NetBSD: d_c99_bool_strict.c,v 1.43 2023/07/09 11:18:55 rillig Exp $    */
 # 3 "d_c99_bool_strict.c"
 
 /*
@@ -297,7 +297,7 @@ strict_bool_conversion_return_2(void)
        return 2;
 }
 
-/* expect+2: warning: argument 'p' unused in function 'strict_bool_conversion_return_pointer' [231] */
+/* expect+2: warning: parameter 'p' unused in function 'strict_bool_conversion_return_pointer' [231] */
 bool
 strict_bool_conversion_return_pointer(const void *p)
 {
@@ -393,7 +393,7 @@ strict_bool_conversion_between_bool_and_
        b = i;
 }
 
-/* expect+2: warning: argument 'b' unused in function 'strict_bool_conversion_from_bool_to_scalar' [231] */
+/* expect+2: warning: parameter 'b' unused in function 'strict_bool_conversion_from_bool_to_scalar' [231] */
 void
 strict_bool_conversion_from_bool_to_scalar(bool b)
 {
@@ -815,7 +815,7 @@ enum Flags {
        FLAG28 = 1 << 28
 };
 
-/* expect+2: warning: argument 'flags' unused in function 'strict_bool_bitwise_and_enum' [231] */
+/* expect+2: warning: parameter 'flags' unused in function 'strict_bool_bitwise_and_enum' [231] */
 void
 strict_bool_bitwise_and_enum(enum Flags flags)
 {
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c
--- a/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c    Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c    Sun Jul 09 11:18:55 2023 +0000
@@ -9,10 +9,10 @@
 
 void func(int a, int b, int c);
 
-/* expect+4: warning: argument 'num' unused in function 'func' [231] */
-/* expect+3: warning: argument 'ptr' unused in function 'func' [231] */
-/* expect+2: warning: argument 'dbl' unused in function 'func' [231] */
-/* expect+1: warning: argument 'def' unused in function 'func' [231] */
+/* expect+4: warning: parameter 'num' unused in function 'func' [231] */
+/* expect+3: warning: parameter 'ptr' unused in function 'func' [231] */
+/* expect+2: warning: parameter 'dbl' unused in function 'func' [231] */
+/* expect+1: warning: parameter 'def' unused in function 'func' [231] */
 void func(num, ptr, dbl, def)
     int num;
     char *ptr;
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/d_fold_test.c
--- a/tests/usr.bin/xlint/lint1/d_fold_test.c   Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/d_fold_test.c   Sun Jul 09 11:18:55 2023 +0000
@@ -59,28 +59,28 @@ void if_enum(enum e e)                      { if (e) return
 /* C99 6.2.5p20 */
 void if_array(struct arr arr)          { if (arr.arr) return; }
 /* expect+2: error: controlling expressions must have scalar type [204] */
-/* expect+1: warning: argument 's' unused in function 'if_struct' [231] */
+/* expect+1: warning: parameter 's' unused in function 'if_struct' [231] */
 void if_struct(struct s s)             { if (s) return; }
 /* expect+2: error: controlling expressions must have scalar type [204] */
-/* expect+1: warning: argument 'u' unused in function 'if_union' [231] */
+/* expect+1: warning: parameter 'u' unused in function 'if_union' [231] */
 void if_union(union u u)               { if (u) return; }
 void if_function(void)                 { if (if_function) return; }
 void if_pointer(void *p)               { if (p) return; }
 
 /* C99 6.8.5 */
 /* expect+2: error: controlling expressions must have scalar type [204] */
-/* expect+1: warning: argument 's' unused in function 'while_struct' [231] */
+/* expect+1: warning: parameter 's' unused in function 'while_struct' [231] */
 void while_struct(struct s s)          { while (s) return; }
 /* expect+3: error: controlling expressions must have scalar type [204] */
 /* expect+2: warning: end-of-loop code not reached [223] */
-/* expect+1: warning: argument 's' unused in function 'for_struct' [231] */
+/* expect+1: warning: parameter 's' unused in function 'for_struct' [231] */
 void for_struct(struct s s)            { for (;s;) return; }
 /* expect+2: error: controlling expressions must have scalar type [204] */
-/* expect+1: warning: argument 's' unused in function 'do_while_struct' [231] */
+/* expect+1: warning: parameter 's' unused in function 'do_while_struct' [231] */
 void do_while_struct(struct s s)       { do { return; } while (s); }
 
 /* C99 6.5.15 does not require a scalar type, curiously. */
-/* expect+3: error: first operand must have scalar type, op ? : [170] */
+/* expect+3: error: first operand of '?' must have scalar type [170] */
 /* expect+2: warning: function 'conditional_struct' expects to return value [214] */
-/* expect+1: warning: argument 's' unused in function 'conditional_struct' [231] */
+/* expect+1: warning: parameter 's' unused in function 'conditional_struct' [231] */
 int conditional_struct(struct s s)     { return s ? 1 : 2; }
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/decl_arg.c
--- a/tests/usr.bin/xlint/lint1/decl_arg.c      Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_arg.c      Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: decl_arg.c,v 1.9 2023/07/09 11:01:27 rillig Exp $      */
+/*     $NetBSD: decl_arg.c,v 1.10 2023/07/09 11:18:55 rillig Exp $     */
 # 3 "decl_arg.c"
 
 /*
@@ -23,11 +23,11 @@ void type_qualifier_pointer(const number
 /*
  * Just some unrealistic coverage for the grammar rule 'arg_declaration'.
  */
-/* expect+6: warning: argument 'an_int' unused in function 'old_style' [231] */
-/* expect+5: warning: argument 'a_const_int' unused in function 'old_style' [231] */
-/* expect+4: warning: argument 'a_number' unused in function 'old_style' [231] */
-/* expect+3: warning: argument 'a_function' unused in function 'old_style' [231] */
-/* expect+2: warning: argument 'a_struct' unused in function 'old_style' [231] */
+/* expect+6: warning: parameter 'an_int' unused in function 'old_style' [231] */
+/* expect+5: warning: parameter 'a_const_int' unused in function 'old_style' [231] */
+/* expect+4: warning: parameter 'a_number' unused in function 'old_style' [231] */
+/* expect+3: warning: parameter 'a_function' unused in function 'old_style' [231] */
+/* expect+2: warning: parameter 'a_struct' unused in function 'old_style' [231] */
 extern void
 old_style(an_int, a_const_int, a_number, a_function, a_struct)
 /* expect+2: warning: empty declaration [2] */
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/expr_sizeof.c
--- a/tests/usr.bin/xlint/lint1/expr_sizeof.c   Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_sizeof.c   Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expr_sizeof.c,v 1.12 2023/06/30 21:06:18 rillig Exp $  */
+/*     $NetBSD: expr_sizeof.c,v 1.13 2023/07/09 11:18:55 rillig Exp $  */
 # 3 "expr_sizeof.c"
 
 /*
@@ -60,7 +60,7 @@ int arr[] = { 1, 2, 3 };
 typedef int arr_count[-(int)sizeof(arr) / (int)sizeof(arr)[0]];
 
 /* FIXME: 'n' is actually used, for the variable length array. */
-/* expect+2: warning: argument 'n' unused in function 'variable_length_array' [231] */
+/* expect+2: warning: parameter 'n' unused in function 'variable_length_array' [231] */
 void
 variable_length_array(int n)
 {
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/msg_019.c
--- a/tests/usr.bin/xlint/lint1/msg_019.c       Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_019.c       Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_019.c,v 1.7 2023/03/28 14:44:34 rillig Exp $       */
+/*     $NetBSD: msg_019.c,v 1.8 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "msg_019.c"
 
 // Test for message: void type for '%s' [19]
@@ -12,7 +12,7 @@ void global_variable;
 /* expect+1: warning: static variable 'unit_variable' unused [226] */
 static void unit_variable;
 
-/* expect+3: warning: argument 'parameter' unused in function 'function' [231] */
+/* expect+3: warning: parameter 'parameter' unused in function 'function' [231] */
 /* expect+2: error: void parameter 'parameter' cannot have name [61] */
 void
 function(void parameter)
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/msg_050.c
--- a/tests/usr.bin/xlint/lint1/msg_050.c       Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_050.c       Sun Jul 09 11:18:55 2023 +0000
@@ -1,15 +1,15 @@
-/*     $NetBSD: msg_050.c,v 1.6 2023/07/07 19:45:22 rillig Exp $       */
+/*     $NetBSD: msg_050.c,v 1.7 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "msg_050.c"
 
-/* Test for message: argument '%s' has function type, should be pointer [50] */
+/* Test for message: parameter '%s' has function type, should be pointer [50] */
 
 /* lint1-flags: -tw */
 
 typedef void (function)();
 
-/* expect+1: warning: argument 'f' unused in function 'example' [231] */
+/* expect+1: warning: parameter 'f' unused in function 'example' [231] */
 void example(f)
-    /* expect+1: warning: argument 'f' has function type, should be pointer [50] */
+    /* expect+1: warning: parameter 'f' has function type, should be pointer [50] */
     function f;
 {
 }
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/msg_051.c
--- a/tests/usr.bin/xlint/lint1/msg_051.c       Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_051.c       Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_051.c,v 1.6 2023/03/28 14:44:34 rillig Exp $       */
+/*     $NetBSD: msg_051.c,v 1.7 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "msg_051.c"
 
 // Test for message: parameter mismatch: %d declared, %d defined [51]
@@ -9,9 +9,9 @@ void
 example(int, int);
 
 void
-/* expect+3: warning: argument 'a' unused in function 'example' [231] */
-/* expect+2: warning: argument 'b' unused in function 'example' [231] */
-/* expect+1: warning: argument 'c' unused in function 'example' [231] */
+/* expect+3: warning: parameter 'a' unused in function 'example' [231] */
+/* expect+2: warning: parameter 'b' unused in function 'example' [231] */
+/* expect+1: warning: parameter 'c' unused in function 'example' [231] */
 example(a, b, c)
     int a, b, c;
 /* expect+1: error: parameter mismatch: 2 declared, 3 defined [51] */
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/msg_057.c
--- a/tests/usr.bin/xlint/lint1/msg_057.c       Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_057.c       Sun Jul 09 11:18:55 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_057.c,v 1.7 2023/07/07 19:45:22 rillig Exp $       */
+/*     $NetBSD: msg_057.c,v 1.8 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "msg_057.c"
 
 // Test for message: enumeration constant '%s' hides parameter [57]
@@ -6,9 +6,9 @@
 /* lint1-extra-flags: -X 351 */
 
 long
-/* expect+3: warning: argument 'red' unused in function 'rgb' [231] */
-/* expect+2: warning: argument 'green' unused in function 'rgb' [231] */
-/* expect+1: warning: argument 'blue' unused in function 'rgb' [231] */
+/* expect+3: warning: parameter 'red' unused in function 'rgb' [231] */
+/* expect+2: warning: parameter 'green' unused in function 'rgb' [231] */
+/* expect+1: warning: parameter 'blue' unused in function 'rgb' [231] */
 rgb(int red, int green, int blue)
 {
        enum color {
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/msg_097.c
--- a/tests/usr.bin/xlint/lint1/msg_097.c       Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_097.c       Sun Jul 09 11:18:55 2023 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_097.c,v 1.5 2023/07/07 06:03:31 rillig Exp $       */
+/*     $NetBSD: msg_097.c,v 1.6 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "msg_097.c"
 
-/* Test for message: suffix U is illegal in traditional C [97] */
+/* Test for message: suffix 'U' is illegal in traditional C [97] */
 
 /* lint1-flags: -gtw -X 191 */
 
@@ -11,16 +11,16 @@ example()
        int i = 1234567;
        unsigned u = 1234567;
 
-       /* expect+1: warning: suffix U is illegal in traditional C [97] */
+       /* expect+1: warning: suffix 'U' is illegal in traditional C [97] */
        unsigned u_upper = 1234567U;
-       /* expect+1: warning: suffix U is illegal in traditional C [97] */
+       /* expect+1: warning: suffix 'U' is illegal in traditional C [97] */
        unsigned u_lower = 1234567u;
 
        long l = 1234567L;
-       /* expect+1: warning: suffix U is illegal in traditional C [97] */
+       /* expect+1: warning: suffix 'U' is illegal in traditional C [97] */
        unsigned long ul = 1234567UL;
 
        long long ll = 1234567LL;
-       /* expect+1: warning: suffix U is illegal in traditional C [97] */
+       /* expect+1: warning: suffix 'U' is illegal in traditional C [97] */
        unsigned long long ull = 1234567ULL;
 }
diff -r 5d52602bf314 -r 930e24c5d145 tests/usr.bin/xlint/lint1/msg_098.c
--- a/tests/usr.bin/xlint/lint1/msg_098.c       Sun Jul 09 11:01:27 2023 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_098.c       Sun Jul 09 11:18:55 2023 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_098.c,v 1.5 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_098.c,v 1.6 2023/07/09 11:18:55 rillig Exp $       */
 # 3 "msg_098.c"
 



Home | Main Index | Thread Index | Old Index