Module Name: src
Committed By: rillig
Date: Wed Jun 22 19:23:18 UTC 2022
Modified Files:
src/tests/usr.bin/xlint/lint1: c11_generic_expression.c d_alignof.c
d_c99_bool_strict.c d_c99_bool_strict_syshdr.c
d_c99_complex_split.c d_c99_init.c d_init_array_using_string.c
d_return_type.c decl.c emit.c gcc_builtin_alloca.c
gcc_typeof_after_statement.c init.c init_braces.c
lex_integer_ilp32.c msg_016.c msg_017.c msg_018.c msg_065.c
msg_091.c msg_113.c msg_128.c msg_137.c msg_142.c msg_149.c
msg_150.c msg_154.c msg_156.c msg_158.c msg_162.c msg_182.c
msg_183.c msg_190.c msg_194.c msg_211.c msg_213.c msg_215.c
msg_216.c msg_217.c msg_218.c msg_222.c msg_225.c msg_227.c
msg_230_uchar.c msg_241.c msg_242.c msg_243.c msg_246.c msg_257.c
msg_258.c msg_261.c msg_276.c msg_280.c msg_281.c msg_282.c
msg_283.c msg_290.c msg_302.c msg_306.c msg_324.c msg_326.c
msg_346.c
src/usr.bin/xlint/lint1: ckbool.c decl.c err.c func.c init.c tree.c
Log Message:
lint: add quotes around placeholders for the remaining messages
Reword some of the messages slightly, exchanging brevity for clarity.
Message 138 is kept as-is, as it is not yet covered by any tests.
Message 240 is kep as-is, as it is unreachable.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/tests/usr.bin/xlint/lint1/c11_generic_expression.c \
src/tests/usr.bin/xlint/lint1/emit.c src/tests/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/d_alignof.c
cvs rdiff -u -r1.38 -r1.39 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
cvs rdiff -u -r1.17 -r1.18 \
src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c \
src/tests/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.10 -r1.11 \
src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c \
src/tests/usr.bin/xlint/lint1/msg_217.c
cvs rdiff -u -r1.41 -r1.42 src/tests/usr.bin/xlint/lint1/d_c99_init.c
cvs rdiff -u -r1.11 -r1.12 \
src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \
src/tests/usr.bin/xlint/lint1/msg_215.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_return_type.c \
src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c \
src/tests/usr.bin/xlint/lint1/msg_018.c \
src/tests/usr.bin/xlint/lint1/msg_091.c \
src/tests/usr.bin/xlint/lint1/msg_128.c \
src/tests/usr.bin/xlint/lint1/msg_150.c \
src/tests/usr.bin/xlint/lint1/msg_154.c \
src/tests/usr.bin/xlint/lint1/msg_158.c \
src/tests/usr.bin/xlint/lint1/msg_211.c \
src/tests/usr.bin/xlint/lint1/msg_216.c \
src/tests/usr.bin/xlint/lint1/msg_257.c \
src/tests/usr.bin/xlint/lint1/msg_261.c \
src/tests/usr.bin/xlint/lint1/msg_283.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/gcc_builtin_alloca.c
cvs rdiff -u -r1.3 -r1.4 \
src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c \
src/tests/usr.bin/xlint/lint1/msg_016.c \
src/tests/usr.bin/xlint/lint1/msg_017.c \
src/tests/usr.bin/xlint/lint1/msg_065.c \
src/tests/usr.bin/xlint/lint1/msg_113.c \
src/tests/usr.bin/xlint/lint1/msg_137.c \
src/tests/usr.bin/xlint/lint1/msg_149.c \
src/tests/usr.bin/xlint/lint1/msg_182.c \
src/tests/usr.bin/xlint/lint1/msg_183.c \
src/tests/usr.bin/xlint/lint1/msg_190.c \
src/tests/usr.bin/xlint/lint1/msg_194.c \
src/tests/usr.bin/xlint/lint1/msg_213.c \
src/tests/usr.bin/xlint/lint1/msg_218.c \
src/tests/usr.bin/xlint/lint1/msg_222.c \
src/tests/usr.bin/xlint/lint1/msg_225.c \
src/tests/usr.bin/xlint/lint1/msg_227.c \
src/tests/usr.bin/xlint/lint1/msg_243.c \
src/tests/usr.bin/xlint/lint1/msg_246.c \
src/tests/usr.bin/xlint/lint1/msg_258.c \
src/tests/usr.bin/xlint/lint1/msg_276.c \
src/tests/usr.bin/xlint/lint1/msg_281.c \
src/tests/usr.bin/xlint/lint1/msg_282.c \
src/tests/usr.bin/xlint/lint1/msg_290.c \
src/tests/usr.bin/xlint/lint1/msg_302.c \
src/tests/usr.bin/xlint/lint1/msg_306.c \
src/tests/usr.bin/xlint/lint1/msg_326.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/init_braces.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_142.c \
src/tests/usr.bin/xlint/lint1/msg_156.c \
src/tests/usr.bin/xlint/lint1/msg_162.c \
src/tests/usr.bin/xlint/lint1/msg_324.c \
src/tests/usr.bin/xlint/lint1/msg_346.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c \
src/tests/usr.bin/xlint/lint1/msg_241.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_242.c \
src/tests/usr.bin/xlint/lint1/msg_280.c
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/xlint/lint1/ckbool.c
cvs rdiff -u -r1.292 -r1.293 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.175 -r1.176 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.458 -r1.459 src/usr.bin/xlint/lint1/tree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/c11_generic_expression.c
diff -u src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.12 src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.13
--- src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.12 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/c11_generic_expression.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: c11_generic_expression.c,v 1.12 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: c11_generic_expression.c,v 1.13 2022/06/22 19:23:18 rillig Exp $ */
# 3 "c11_generic_expression.c"
/*
@@ -74,7 +74,7 @@ comma_expression(char first, double seco
char: "first",
double: 2.0
);
- /* expect+1: warning: function comma_expression falls off bottom without returning value [217] */
+ /* expect+1: warning: function 'comma_expression' falls off bottom without returning value [217] */
}
/*
Index: src/tests/usr.bin/xlint/lint1/emit.c
diff -u src/tests/usr.bin/xlint/lint1/emit.c:1.12 src/tests/usr.bin/xlint/lint1/emit.c:1.13
--- src/tests/usr.bin/xlint/lint1/emit.c:1.12 Sat Jun 11 11:52:13 2022
+++ src/tests/usr.bin/xlint/lint1/emit.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: emit.c,v 1.12 2022/06/11 11:52:13 rillig Exp $ */
+/* $NetBSD: emit.c,v 1.13 2022/06/22 19:23:18 rillig Exp $ */
# 3 "emit.c"
/*
@@ -125,7 +125,7 @@ extern /* implicit int */ return_implici
/* For function declarations, the keyword 'extern' is optional. */
extern void extern_return_void_no_parameters(void);
/* implicit extern */ void return_void_no_parameters(void);
-/* expect+1: warning: static function static_return_void_no_parameters declared but not defined [290] */
+/* expect+1: warning: static function 'static_return_void_no_parameters' declared but not defined [290] */
static void static_return_void_no_parameters(void);
void taking_int(int);
@@ -145,7 +145,7 @@ void taking_varargs(const char *, ...);
* is nevertheless recorded. There's probably a good reason for recording
* it.
*/
-/* expect+1: warning: static function static_function declared but not defined [290] */
+/* expect+1: warning: static function 'static_function' declared but not defined [290] */
static int static_function(void);
void my_printf(const char *, ...);
Index: src/tests/usr.bin/xlint/lint1/init.c
diff -u src/tests/usr.bin/xlint/lint1/init.c:1.12 src/tests/usr.bin/xlint/lint1/init.c:1.13
--- src/tests/usr.bin/xlint/lint1/init.c:1.12 Sun Jun 19 11:50:42 2022
+++ src/tests/usr.bin/xlint/lint1/init.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.12 2022/06/19 11:50:42 rillig Exp $ */
+/* $NetBSD: init.c,v 1.13 2022/06/22 19:23:18 rillig Exp $ */
# 3 "init.c"
/*
@@ -12,7 +12,7 @@
* Lint allows this syntactically, it just complains if the resulting
* object is empty.
*/
-/* expect+1: error: empty array declaration: empty_array_with_initializer [190] */
+/* expect+1: error: empty array declaration for 'empty_array_with_initializer' [190] */
double empty_array_with_initializer[] = {};
double array_with_empty_initializer[3] = {};
Index: src/tests/usr.bin/xlint/lint1/d_alignof.c
diff -u src/tests/usr.bin/xlint/lint1/d_alignof.c:1.7 src/tests/usr.bin/xlint/lint1/d_alignof.c:1.8
--- src/tests/usr.bin/xlint/lint1/d_alignof.c:1.7 Thu May 12 20:57:49 2022
+++ src/tests/usr.bin/xlint/lint1/d_alignof.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_alignof.c,v 1.7 2022/05/12 20:57:49 rillig Exp $ */
+/* $NetBSD: d_alignof.c,v 1.8 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_alignof.c"
/* https://gcc.gnu.org/onlinedocs/gcc/Alignment.html */
@@ -23,7 +23,7 @@ plain_alignof_type(void)
/* expect+1: error: syntax error 'short' [249] */
return alignof(short);
}
-/* expect-1: warning: function plain_alignof_type falls off bottom without returning value [217] */
+/* expect-1: warning: function 'plain_alignof_type' falls off bottom without returning value [217] */
unsigned long
leading_and_trailing_alignof_expr(void)
@@ -45,7 +45,7 @@ plain_alignof_expr(void)
/* expect+1: error: syntax error '3' [249] */
return alignof 3;
}
-/* expect-1: warning: function plain_alignof_expr falls off bottom without returning value [217] */
+/* expect-1: warning: function 'plain_alignof_expr' falls off bottom without returning value [217] */
/*
Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.38 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.39
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c:1.38 Sun Jun 19 12:14:34 2022
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_c99_bool_strict.c,v 1.38 2022/06/19 12:14:34 rillig Exp $ */
+/* $NetBSD: d_c99_bool_strict.c,v 1.39 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_c99_bool_strict.c"
/*
@@ -279,21 +279,21 @@ strict_bool_conversion_return_bool(bool
bool
strict_bool_conversion_return_0(void)
{
- /* expect+1: error: return value type mismatch (_Bool) and (int) [211] */
+ /* expect+1: error: function has return type '_Bool' but returns 'int' [211] */
return 0;
}
bool
strict_bool_conversion_return_1(void)
{
- /* expect+1: error: return value type mismatch (_Bool) and (int) [211] */
+ /* expect+1: error: function has return type '_Bool' but returns 'int' [211] */
return 1;
}
bool
strict_bool_conversion_return_2(void)
{
- /* expect+1: error: return value type mismatch (_Bool) and (int) [211] */
+ /* expect+1: error: function has return type '_Bool' but returns 'int' [211] */
return 2;
}
@@ -301,21 +301,21 @@ strict_bool_conversion_return_2(void)
bool
strict_bool_conversion_return_pointer(const void *p)
{
- /* expect+1: error: return value type mismatch (_Bool) and (pointer) [211] */
+ /* expect+1: error: function has return type '_Bool' but returns 'pointer' [211] */
return p;
}
char
strict_bool_conversion_return_false_as_char(void)
{
- /* expect+1: error: return value type mismatch (char) and (_Bool) [211] */
+ /* expect+1: error: function has return type 'char' but returns '_Bool' [211] */
return __lint_false;
}
char
strict_bool_conversion_return_true_as_char(void)
{
- /* expect+1: error: return value type mismatch (char) and (_Bool) [211] */
+ /* expect+1: error: function has return type 'char' but returns '_Bool' [211] */
return __lint_true;
}
@@ -340,12 +340,12 @@ strict_bool_conversion_function_argument
/* Implicitly converting int to bool (arg #1). */
/* expect+2: error: argument #1 expects '_Bool', gets passed 'int' [334] */
- /* expect+1: warning: illegal combination of pointer (pointer to const char) and integer (int), arg #3 [154] */
+ /* expect+1: warning: illegal combination of pointer 'pointer to const char' and integer 'int', arg #3 [154] */
take_arguments(i, i, i);
/* Implicitly converting pointer to bool (arg #1). */
/* expect+2: error: argument #1 expects '_Bool', gets passed 'pointer' [334] */
- /* expect+1: warning: illegal combination of integer (int) and pointer (pointer to const char), arg #2 [154] */
+ /* expect+1: warning: illegal combination of integer 'int' and pointer 'pointer to const char', arg #2 [154] */
take_arguments(p, p, p);
/* Passing bool as vararg. */
Index: src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c:1.17 src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c:1.18
--- src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c:1.17 Sun Jun 19 12:14:34 2022
+++ src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_c99_bool_strict_syshdr.c,v 1.17 2022/06/19 12:14:34 rillig Exp $ */
+/* $NetBSD: d_c99_bool_strict_syshdr.c,v 1.18 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_c99_bool_strict_syshdr.c"
/*
@@ -153,7 +153,7 @@ extern int strcmp(const char *, const ch
_Bool
call_finite_bad(double d)
{
- /* expect+1: error: return value type mismatch (_Bool) and (int) [211] */
+ /* expect+1: error: function has return type '_Bool' but returns 'int' [211] */
return finite(d);
}
Index: src/tests/usr.bin/xlint/lint1/decl.c
diff -u src/tests/usr.bin/xlint/lint1/decl.c:1.17 src/tests/usr.bin/xlint/lint1/decl.c:1.18
--- src/tests/usr.bin/xlint/lint1/decl.c:1.17 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/decl.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.17 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.18 2022/06/22 19:23:18 rillig Exp $ */
# 3 "decl.c"
/*
@@ -66,7 +66,7 @@ declarators(void)
/* expect+1: warning: converting 'pointer to char' to incompatible 'pointer to double' for argument 1 [153] */
sink(pc);
- /* expect+1: warning: illegal combination of pointer (pointer to double) and integer (char), arg #1 [154] */
+ /* expect+1: warning: illegal combination of pointer 'pointer to double' and integer 'char', arg #1 [154] */
sink(c);
/* expect+1: warning: converting 'pointer to pointer to char' to incompatible 'pointer to double' for argument 1 [153] */
sink(ppc);
@@ -179,5 +179,5 @@ cover_func_declarator(void)
* "elsz > 0" in 'length'.
*/
/* expect+2: error: syntax error 'goto' [249] */
-/* expect+1: warning: empty array declaration: void_array_error [190] */
+/* expect+1: warning: empty array declaration for 'void_array_error' [190] */
void void_array_error[] goto;
Index: src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c:1.10 src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c:1.11
--- src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c:1.10 Sun Jun 19 12:14:34 2022
+++ src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_c99_complex_split.c,v 1.10 2022/06/19 12:14:34 rillig Exp $ */
+/* $NetBSD: d_c99_complex_split.c,v 1.11 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_c99_complex_split.c"
/*
@@ -42,7 +42,7 @@ set_complex_complete(double re, double i
/*
* Before tree.c 1.275 from 2021-04-09, lint wrongly warned that when
- * '__real__ c' was assigned, 'c may be used before set'.
+ * '__real__ c' was assigned, 'c may be used before set [158]'.
*
* As of 2021-04-09, support for _Complex is still very incomplete, see
* build_real_imag for details.
@@ -59,7 +59,7 @@ set_complex_only_real(double re)
/*
* Before tree.c 1.275 from 2021-04-09, lint wrongly warned that when
- * '__imag__ c' was assigned, 'c may be used before set'.
+ * '__imag__ c' was assigned, 'c may be used before set [158]'.
*
* As of 2021-04-09, support for _Complex is still very incomplete, see
* build_real_imag for details.
Index: src/tests/usr.bin/xlint/lint1/msg_217.c
diff -u src/tests/usr.bin/xlint/lint1/msg_217.c:1.10 src/tests/usr.bin/xlint/lint1/msg_217.c:1.11
--- src/tests/usr.bin/xlint/lint1/msg_217.c:1.10 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_217.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_217.c,v 1.10 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_217.c,v 1.11 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_217.c"
-// Test for message: function %s falls off bottom without returning value [217]
+// Test for message: function '%s' falls off bottom without returning value [217]
int
random(int n)
@@ -9,7 +9,7 @@ random(int n)
if (n < 0)
return -3;
}
-/* expect-1: warning: function random falls off bottom without returning value [217] */
+/* expect-1: warning: function 'random' falls off bottom without returning value [217] */
/*
* The pattern 'do { } while (0)' is often used in statement macros.
@@ -68,4 +68,4 @@ unreachable_continue_falls_through(void)
break;
}
}
-/* expect-1: warning: function unreachable_continue_falls_through falls off bottom without returning value [217] */
+/* expect-1: warning: function 'unreachable_continue_falls_through' falls off bottom without returning value [217] */
Index: src/tests/usr.bin/xlint/lint1/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.41 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.42
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.41 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_c99_init.c,v 1.41 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: d_c99_init.c,v 1.42 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_c99_init.c"
/*
@@ -241,7 +241,7 @@ struct ends_with_unnamed_bit_field {
char prefixed_message[] = {
'E', ':', ' ',
- /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to char) [183] */
+ /* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to char' [183] */
"message\n",
};
@@ -458,7 +458,7 @@ struct point unknown_member_on_scalar =
struct {
int:16;
- /* expect+2: warning: structure has no named members [65] */
+ /* expect+2: warning: 'struct <unnamed>' has no named members [65] */
/* expect+1: error: cannot initialize struct/union with no named member [179] */
} struct_with_only_unnamed_members = {
123,
@@ -466,7 +466,7 @@ struct {
union {
int:16;
- /* expect+2: warning: union has no named members [65] */
+ /* expect+2: warning: 'union <unnamed>' has no named members [65] */
/* expect+1: error: cannot initialize struct/union with no named member [179] */
} union_with_only_unnamed_members = {
123,
Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c
diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.11 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.12
--- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.11 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_init_array_using_string.c,v 1.11 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: d_init_array_using_string.c,v 1.12 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_init_array_using_string.c"
/*
@@ -60,9 +60,9 @@ test_array_initialization_in_struct(void
};
struct cs_ws type_mismatch = {
- /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to int) [183] */
+ /* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to int' [183] */
L"",
- /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to char) [183] */
+ /* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to char' [183] */
"",
};
Index: src/tests/usr.bin/xlint/lint1/msg_215.c
diff -u src/tests/usr.bin/xlint/lint1/msg_215.c:1.11 src/tests/usr.bin/xlint/lint1/msg_215.c:1.12
--- src/tests/usr.bin/xlint/lint1/msg_215.c:1.11 Sun Aug 29 17:01:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_215.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_215.c,v 1.11 2021/08/29 17:01:27 rillig Exp $ */
+/* $NetBSD: msg_215.c,v 1.12 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_215.c"
// Test for message: function '%s' implicitly declared to return int [215]
@@ -21,11 +21,11 @@ test(struct str str, const double *p_dou
name();
/* expect+2: error: 'parenthesized' undefined [99] */
- /* expect+1: error: illegal function (type int) [149] */
+ /* expect+1: error: cannot call 'int', must be a function [149] */
(parenthesized)();
/* expect+2: error: type 'struct str' does not have member 'member' [101] */
- /* expect+1: error: illegal function (type int) [149] */
+ /* expect+1: error: cannot call 'int', must be a function [149] */
str.member();
/* https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html */
Index: src/tests/usr.bin/xlint/lint1/d_return_type.c
diff -u src/tests/usr.bin/xlint/lint1/d_return_type.c:1.4 src/tests/usr.bin/xlint/lint1/d_return_type.c:1.5
--- src/tests/usr.bin/xlint/lint1/d_return_type.c:1.4 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/d_return_type.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_return_type.c,v 1.4 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: d_return_type.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "d_return_type.c"
enum A {
@@ -12,6 +12,6 @@ enum B {
enum A
func(enum B arg)
{
- /* expect+1: warning: return value type mismatch (enum A) and (enum B) [211] */
+ /* expect+1: warning: function has return type 'enum A' but returns 'enum B' [211] */
return arg;
}
Index: src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c
diff -u src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.4 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.5
--- src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.4 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_integer_ilp32.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: lex_integer_ilp32.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "lex_integer_ilp32.c"
/*
@@ -27,7 +27,7 @@ test_signed_int(void)
sinki(-2147483647);
- /* expect+2: warning: ANSI C treats constant as unsigned, op - [218] */
+ /* expect+2: warning: ANSI C treats constant as unsigned, op '-' [218] */
/* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
sinki(-2147483648);
}
Index: src/tests/usr.bin/xlint/lint1/msg_018.c
diff -u src/tests/usr.bin/xlint/lint1/msg_018.c:1.4 src/tests/usr.bin/xlint/lint1/msg_018.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_018.c:1.4 Tue Apr 5 23:09:19 2022
+++ src/tests/usr.bin/xlint/lint1/msg_018.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_018.c,v 1.4 2022/04/05 23:09:19 rillig Exp $ */
+/* $NetBSD: msg_018.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_018.c"
// Test for message: illegal use of 'void' [18]
@@ -10,5 +10,5 @@ void x;
unsigned long sizeof_void = sizeof(void);
/* expect+2: error: illegal use of 'void' [18] */
-/* expect+1: warning: empty array declaration: void_array [190] */
+/* expect+1: warning: empty array declaration for 'void_array' [190] */
void void_array[];
Index: src/tests/usr.bin/xlint/lint1/msg_091.c
diff -u src/tests/usr.bin/xlint/lint1/msg_091.c:1.4 src/tests/usr.bin/xlint/lint1/msg_091.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_091.c:1.4 Mon Jun 20 21:13:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_091.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_091.c,v 1.4 2022/06/20 21:13:36 rillig Exp $ */
+/* $NetBSD: msg_091.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_091.c"
/* Test for message: declaration of '%s' hides parameter [91] */
@@ -11,6 +11,6 @@ add(a, b)
/* expect+1: warning: declaration of 'a' hides parameter [91] */
int a;
- /* expect+1: warning: a may be used before set [158] */
+ /* expect+1: warning: 'a' may be used before set [158] */
return a + b;
}
Index: src/tests/usr.bin/xlint/lint1/msg_128.c
diff -u src/tests/usr.bin/xlint/lint1/msg_128.c:1.4 src/tests/usr.bin/xlint/lint1/msg_128.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_128.c:1.4 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_128.c Wed Jun 22 19:23:18 2022
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_128.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_128.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_128.c"
-// Test for message: operands have incompatible pointer types, op %s (%s != %s) [128]
+// Test for message: operands of '%s' have incompatible pointer types to '%s' and '%s' [128]
void
conversion_to_unconst(const char *cstr)
{
char *str;
- /* expect+1: warning: operands have incompatible pointer types, op = (char != const char) [128] */
+ /* expect+1: warning: operands of '=' have incompatible pointer types to 'char' and 'const char' [128] */
str = cstr;
}
Index: src/tests/usr.bin/xlint/lint1/msg_150.c
diff -u src/tests/usr.bin/xlint/lint1/msg_150.c:1.4 src/tests/usr.bin/xlint/lint1/msg_150.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_150.c:1.4 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_150.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_150.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_150.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_150.c"
-// Test for message: argument mismatch: %d arg%s passed, %d expected [150]
+// Test for message: argument mismatch: %d %s passed, %d expected [150]
int
add2(int, int);
@@ -9,6 +9,6 @@ add2(int, int);
int
example(void)
{
- /* expect+1: error: argument mismatch: 4 args passed, 2 expected [150] */
+ /* expect+1: error: argument mismatch: 4 arguments passed, 2 expected [150] */
return add2(2, 3, 5, 7);
}
Index: src/tests/usr.bin/xlint/lint1/msg_154.c
diff -u src/tests/usr.bin/xlint/lint1/msg_154.c:1.4 src/tests/usr.bin/xlint/lint1/msg_154.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_154.c:1.4 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_154.c Wed Jun 22 19:23:18 2022
@@ -1,13 +1,13 @@
-/* $NetBSD: msg_154.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_154.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_154.c"
-// Test for message: illegal combination of %s (%s) and %s (%s), arg #%d [154]
+// Test for message: illegal combination of %s '%s' and %s '%s', arg #%d [154]
void sink_int(int);
void
example(int *ptr)
{
- /* expect+1: warning: illegal combination of integer (int) and pointer (pointer to int), arg #1 [154] */
+ /* expect+1: warning: illegal combination of integer 'int' and pointer 'pointer to int', arg #1 [154] */
sink_int(ptr);
}
Index: src/tests/usr.bin/xlint/lint1/msg_158.c
diff -u src/tests/usr.bin/xlint/lint1/msg_158.c:1.4 src/tests/usr.bin/xlint/lint1/msg_158.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_158.c:1.4 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_158.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_158.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_158.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_158.c"
-// Test for message: %s may be used before set [158]
+// Test for message: '%s' may be used before set [158]
void sink_int(int);
@@ -10,7 +10,7 @@ example(int arg)
{
int twice_arg;
- /* expect+1: warning: twice_arg may be used before set [158] */
+ /* expect+1: warning: 'twice_arg' may be used before set [158] */
sink_int(twice_arg);
twice_arg = 2 * arg;
sink_int(twice_arg);
Index: src/tests/usr.bin/xlint/lint1/msg_211.c
diff -u src/tests/usr.bin/xlint/lint1/msg_211.c:1.4 src/tests/usr.bin/xlint/lint1/msg_211.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_211.c:1.4 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/msg_211.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_211.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: msg_211.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_211.c"
-// Test for message: return value type mismatch (%s) and (%s) [211]
+// Test for message: function has return type '%s' but returns '%s' [211]
struct str {
int member;
@@ -13,10 +13,10 @@ return_int(double dbl, void *ptr, struct
if (dbl > 0.0)
return dbl;
if (ptr != (void *)0)
- /* expect+1: warning: illegal combination of integer (int) and pointer (pointer to void) [183] */
+ /* expect+1: warning: illegal combination of integer 'int' and pointer 'pointer to void' [183] */
return ptr;
if (str.member > 0)
- /* expect+1: error: return value type mismatch (int) and (struct str) [211] */
+ /* expect+1: error: function has return type 'int' but returns 'struct str' [211] */
return str;
return 3;
}
Index: src/tests/usr.bin/xlint/lint1/msg_216.c
diff -u src/tests/usr.bin/xlint/lint1/msg_216.c:1.4 src/tests/usr.bin/xlint/lint1/msg_216.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_216.c:1.4 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_216.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_216.c,v 1.4 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_216.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_216.c"
-// Test for message: function %s has return (e); and return; [216]
+// Test for message: function '%s' has 'return expr' and 'return' [216]
/* expect+2: error: old style declaration; add 'int' [1] */
random(int n)
@@ -11,4 +11,4 @@ random(int n)
if (n < 2)
return;
}
-/* expect-1: warning: function random has return (e); and return; [216] */
+/* expect-1: warning: function 'random' has 'return expr' and 'return' [216] */
Index: src/tests/usr.bin/xlint/lint1/msg_257.c
diff -u src/tests/usr.bin/xlint/lint1/msg_257.c:1.4 src/tests/usr.bin/xlint/lint1/msg_257.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_257.c:1.4 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/msg_257.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_257.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: msg_257.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_257.c"
// Test for message: extra characters in lint comment [257]
@@ -14,7 +14,7 @@ void take(const void *);
/* PRINTFLIKE 7 */
void
my_printf(const char *fmt)
-/* expect+1: warning: argument number mismatch with directive: ** PRINTFLIKE ** [283] */
+/* expect+1: warning: argument number mismatch with directive ** PRINTFLIKE ** [283] */
{
take(fmt);
}
Index: src/tests/usr.bin/xlint/lint1/msg_261.c
diff -u src/tests/usr.bin/xlint/lint1/msg_261.c:1.4 src/tests/usr.bin/xlint/lint1/msg_261.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_261.c:1.4 Sat Jun 11 11:52:13 2022
+++ src/tests/usr.bin/xlint/lint1/msg_261.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_261.c,v 1.4 2022/06/11 11:52:13 rillig Exp $ */
+/* $NetBSD: msg_261.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_261.c"
// Test for message: previous definition of '%s' [261]
@@ -12,5 +12,5 @@ function(void)
}
/* expect+2: error: redeclaration of 'function' with type 'function(void) returning int', expected 'function(void) returning void' [347] */
-/* expect+1: warning: static function function declared but not defined [290] */
+/* expect+1: warning: static function 'function' declared but not defined [290] */
static int function(void);
Index: src/tests/usr.bin/xlint/lint1/msg_283.c
diff -u src/tests/usr.bin/xlint/lint1/msg_283.c:1.4 src/tests/usr.bin/xlint/lint1/msg_283.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_283.c:1.4 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/msg_283.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_283.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: msg_283.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_283.c"
-// Test for message: argument number mismatch with directive: /* %s */ [283]
+// Test for message: argument number mismatch with directive /* %s */ [283]
/* Do not warn about unused parameters. */
/* lint1-extra-flags: -X 231 */
@@ -27,6 +27,6 @@ printflike_2_comment(int a, const char *
/* PRINTFLIKE 3 */
void
printflike_3_comment(int a, const char *fmt)
-/* expect+1: warning: argument number mismatch with directive: ** PRINTFLIKE ** [283] */
+/* expect+1: warning: argument number mismatch with directive ** PRINTFLIKE ** [283] */
{
}
Index: src/tests/usr.bin/xlint/lint1/gcc_builtin_alloca.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_builtin_alloca.c:1.2 src/tests/usr.bin/xlint/lint1/gcc_builtin_alloca.c:1.3
--- src/tests/usr.bin/xlint/lint1/gcc_builtin_alloca.c:1.2 Mon Dec 6 23:26:28 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_builtin_alloca.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_builtin_alloca.c,v 1.2 2021/12/06 23:26:28 rillig Exp $ */
+/* $NetBSD: gcc_builtin_alloca.c,v 1.3 2022/06/22 19:23:18 rillig Exp $ */
# 3 "gcc_builtin_alloca.c"
/*
@@ -17,7 +17,7 @@ example(void)
char *aligned_ptr = __builtin_alloca_with_align(8, 64);
aligned_ptr[0] = '\0';
- /* expect+1: warning: illegal combination of pointer (pointer to char) and integer (int) [183] */
+ /* expect+1: warning: illegal combination of pointer 'pointer to char' and integer 'int' [183] */
char *unknown = __builtin_allocate(8);
unknown[0] = '\0';
}
Index: src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c:1.3 src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c:1.4
--- src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c:1.3 Fri Jun 17 18:54:53 2022
+++ src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_typeof_after_statement.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
+/* $NetBSD: gcc_typeof_after_statement.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "gcc_typeof_after_statement.c"
/*
@@ -18,5 +18,5 @@ example(void **ptr)
}
/* Just to keep the .exp file. */
-/* expect+1: warning: static function unused declared but not defined [290] */
+/* expect+1: warning: static function 'unused' declared but not defined [290] */
static void unused(void);
Index: src/tests/usr.bin/xlint/lint1/msg_016.c
diff -u src/tests/usr.bin/xlint/lint1/msg_016.c:1.3 src/tests/usr.bin/xlint/lint1/msg_016.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_016.c:1.3 Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_016.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_016.c,v 1.3 2021/08/26 19:23:25 rillig Exp $ */
+/* $NetBSD: msg_016.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_016.c"
// Test for message: array of function is illegal [16]
@@ -11,6 +11,6 @@ function functions[] = {
* XXX: The below warning should not assume that function is an
* integer type.
*/
- /* expect+1: warning: illegal combination of integer (int) and pointer (pointer to void) [183] */
+ /* expect+1: warning: illegal combination of integer 'int' and pointer 'pointer to void' [183] */
(void *)0,
};
Index: src/tests/usr.bin/xlint/lint1/msg_017.c
diff -u src/tests/usr.bin/xlint/lint1/msg_017.c:1.3 src/tests/usr.bin/xlint/lint1/msg_017.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_017.c:1.3 Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_017.c Wed Jun 22 19:23:18 2022
@@ -1,13 +1,13 @@
-/* $NetBSD: msg_017.c,v 1.3 2021/08/26 19:23:25 rillig Exp $ */
+/* $NetBSD: msg_017.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_017.c"
// Test for message: null dimension [17]
-/* expect+1: warning: empty array declaration: empty_array_var [190] */
+/* expect+1: warning: empty array declaration for 'empty_array_var' [190] */
int empty_array_var[0];
typedef int empty_array_type[0];
-/* expect+1: warning: empty array declaration: typedef_var [190] */
+/* expect+1: warning: empty array declaration for 'typedef_var' [190] */
empty_array_type typedef_var;
struct s {
Index: src/tests/usr.bin/xlint/lint1/msg_065.c
diff -u src/tests/usr.bin/xlint/lint1/msg_065.c:1.3 src/tests/usr.bin/xlint/lint1/msg_065.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_065.c:1.3 Tue Jul 13 21:50:05 2021
+++ src/tests/usr.bin/xlint/lint1/msg_065.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_065.c,v 1.3 2021/07/13 21:50:05 rillig Exp $ */
+/* $NetBSD: msg_065.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_065.c"
-// Test for message: %s has no named members [65]
+// Test for message: '%s' has no named members [65]
struct ok {
int member;
@@ -15,4 +15,4 @@ struct only_unnamed_members {
unsigned int :14;
unsigned int :0;
};
-/* expect-1: warning: structure has no named members [65] */
+/* expect-1: warning: 'struct only_unnamed_members' has no named members [65] */
Index: src/tests/usr.bin/xlint/lint1/msg_113.c
diff -u src/tests/usr.bin/xlint/lint1/msg_113.c:1.3 src/tests/usr.bin/xlint/lint1/msg_113.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_113.c:1.3 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_113.c Wed Jun 22 19:23:18 2022
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_113.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_113.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_113.c"
-// Test for message: cannot take address of register %s [113]
+// Test for message: cannot take address of register '%s' [113]
/* ARGSUSED */
void
example(register int arg)
{
- /* expect+1: error: cannot take address of register arg [113] */
+ /* expect+1: error: cannot take address of register 'arg' [113] */
return &arg;
}
Index: src/tests/usr.bin/xlint/lint1/msg_137.c
diff -u src/tests/usr.bin/xlint/lint1/msg_137.c:1.3 src/tests/usr.bin/xlint/lint1/msg_137.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_137.c:1.3 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_137.c Wed Jun 22 19:23:18 2022
@@ -1,8 +1,7 @@
-/* $NetBSD: msg_137.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_137.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_137.c"
// Test for message: use of incomplete enum type, op %s [137]
+// This message is not used.
-/* expect+1: error: syntax error ':' [249] */
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* expect+1: warning: empty translation unit [272] */
Index: src/tests/usr.bin/xlint/lint1/msg_149.c
diff -u src/tests/usr.bin/xlint/lint1/msg_149.c:1.3 src/tests/usr.bin/xlint/lint1/msg_149.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_149.c:1.3 Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_149.c Wed Jun 22 19:23:18 2022
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_149.c,v 1.3 2021/08/26 19:23:25 rillig Exp $ */
+/* $NetBSD: msg_149.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_149.c"
-// Test for message: illegal function (type %s) [149]
+// Test for message: cannot call '%s', must be a function [149]
void
example(int i)
{
i++;
- /* expect+1: error: illegal function (type int) [149] */
+ /* expect+1: error: cannot call 'int', must be a function [149] */
i(3);
}
Index: src/tests/usr.bin/xlint/lint1/msg_182.c
diff -u src/tests/usr.bin/xlint/lint1/msg_182.c:1.3 src/tests/usr.bin/xlint/lint1/msg_182.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_182.c:1.3 Mon Aug 16 18:51:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_182.c Wed Jun 22 19:23:18 2022
@@ -1,18 +1,18 @@
-/* $NetBSD: msg_182.c,v 1.3 2021/08/16 18:51:58 rillig Exp $ */
+/* $NetBSD: msg_182.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_182.c"
-// Test for message: incompatible pointer types (%s != %s) [182]
+// Test for message: incompatible pointer types to '%s' and '%s' [182]
void *
return_discarding_volatile(volatile void *arg)
{
- /* expect+1: warning: incompatible pointer types (void != volatile void) [182] */
+ /* expect+1: warning: incompatible pointer types to 'void' and 'volatile void' [182] */
return arg;
}
void
init_discarding_volatile(volatile void *arg)
{
- /* expect+1: warning: incompatible pointer types (void != volatile void) [182] */
+ /* expect+1: warning: incompatible pointer types to 'void' and 'volatile void' [182] */
void *array[] = { arg };
}
Index: src/tests/usr.bin/xlint/lint1/msg_183.c
diff -u src/tests/usr.bin/xlint/lint1/msg_183.c:1.3 src/tests/usr.bin/xlint/lint1/msg_183.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_183.c:1.3 Thu Sep 2 18:20:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_183.c Wed Jun 22 19:23:18 2022
@@ -1,18 +1,18 @@
-/* $NetBSD: msg_183.c,v 1.3 2021/09/02 18:20:00 rillig Exp $ */
+/* $NetBSD: msg_183.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_183.c"
-// Test for message: illegal combination of %s (%s) and %s (%s) [183]
+// Test for message: illegal combination of %s '%s' and %s '%s' [183]
/* expect+2: warning: argument 'x' unused in function 'example' [231] */
void *
example(double x, int i, void *vp, int *ip, double *dp, void (*fp)(void))
{
if (i < 0)
- /* expect+1: error: return value type mismatch (pointer to void) and (double) [211] */
+ /* expect+1: error: function has return type 'pointer to void' but returns 'double' [211] */
return x;
if (i < 1)
- /* expect+1: warning: illegal combination of pointer (pointer to void) and integer (int) [183] */
+ /* expect+1: warning: illegal combination of pointer 'pointer to void' and integer 'int' [183] */
return i;
if (i < 2)
Index: src/tests/usr.bin/xlint/lint1/msg_190.c
diff -u src/tests/usr.bin/xlint/lint1/msg_190.c:1.3 src/tests/usr.bin/xlint/lint1/msg_190.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_190.c:1.3 Sat Jul 10 09:24:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_190.c Wed Jun 22 19:23:18 2022
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_190.c,v 1.3 2021/07/10 09:24:27 rillig Exp $ */
+/* $NetBSD: msg_190.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_190.c"
-// Test for message: empty array declaration: %s [190]
+// Test for message: empty array declaration for '%s' [190]
-/* expect+1: error: empty array declaration: empty_array [190] */
+/* expect+1: error: empty array declaration for 'empty_array' [190] */
double empty_array[] = {};
double array[] = { 1 };
Index: src/tests/usr.bin/xlint/lint1/msg_194.c
diff -u src/tests/usr.bin/xlint/lint1/msg_194.c:1.3 src/tests/usr.bin/xlint/lint1/msg_194.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_194.c:1.3 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_194.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_194.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_194.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_194.c"
-// Test for message: label %s redefined [194]
+// Test for message: label '%s' redefined [194]
void example(void)
{
@@ -10,6 +10,6 @@ label:
/* expect-1: warning: label 'label' unused in function 'example' [232] */
i = 1;
label:
- /* expect-1: error: label label redefined [194] */
+ /* expect-1: error: label 'label' redefined [194] */
i = 2;
}
Index: src/tests/usr.bin/xlint/lint1/msg_213.c
diff -u src/tests/usr.bin/xlint/lint1/msg_213.c:1.3 src/tests/usr.bin/xlint/lint1/msg_213.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_213.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_213.c Wed Jun 22 19:23:18 2022
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_213.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_213.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_213.c"
-// Test for message: void function %s cannot return value [213]
+// Test for message: void function '%s' cannot return value [213]
/* expect+2: warning: argument 'x' unused in function 'example' [231] */
void
example(int x)
{
- /* expect+1: error: void function example cannot return value [213] */
+ /* expect+1: error: void function 'example' cannot return value [213] */
return x;
}
Index: src/tests/usr.bin/xlint/lint1/msg_218.c
diff -u src/tests/usr.bin/xlint/lint1/msg_218.c:1.3 src/tests/usr.bin/xlint/lint1/msg_218.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_218.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_218.c Wed Jun 22 19:23:18 2022
@@ -1,8 +1,17 @@
-/* $NetBSD: msg_218.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_218.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_218.c"
-// Test for message: ANSI C treats constant as unsigned, op %s [218]
+// Test for message: ANSI C treats constant as unsigned, op '%s' [218]
-/* expect+1: error: syntax error ':' [249] */
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+/* lint1-only-if: ilp32 */
+
+void sink_int(int);
+
+/* All platforms supported by lint have 32-bit int in two's complement. */
+void
+test_signed_int(void)
+{
+ /* expect+2: warning: ANSI C treats constant as unsigned, op '-' [218] */
+ /* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
+ sink_int(-2147483648);
+}
Index: src/tests/usr.bin/xlint/lint1/msg_222.c
diff -u src/tests/usr.bin/xlint/lint1/msg_222.c:1.3 src/tests/usr.bin/xlint/lint1/msg_222.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_222.c:1.3 Fri Aug 27 20:49:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_222.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_222.c,v 1.3 2021/08/27 20:49:25 rillig Exp $ */
+/* $NetBSD: msg_222.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_222.c"
// Test for message: conversion of negative constant to unsigned type [222]
@@ -20,7 +20,7 @@ function(void)
if (local & -1)
return;
- /* expect+1: warning: comparison of unsigned int with negative constant, op < [162] */
+ /* expect+1: warning: operator '<' compares 'unsigned int' with 'negative constant' [162] */
if (local < -1)
return;
Index: src/tests/usr.bin/xlint/lint1/msg_225.c
diff -u src/tests/usr.bin/xlint/lint1/msg_225.c:1.3 src/tests/usr.bin/xlint/lint1/msg_225.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_225.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_225.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_225.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_225.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_225.c"
-// Test for message: static function called but not defined: %s() [225]
+// Test for message: static function '%s' called but not defined [225]
static void undefined(void);
@@ -10,7 +10,7 @@ static void defined_later(void);
void
caller(void)
{
- /* expect+1: error: static function called but not defined: undefined() [225] */
+ /* expect+1: error: static function 'undefined' called but not defined [225] */
undefined();
defined_later();
}
Index: src/tests/usr.bin/xlint/lint1/msg_227.c
diff -u src/tests/usr.bin/xlint/lint1/msg_227.c:1.3 src/tests/usr.bin/xlint/lint1/msg_227.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_227.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_227.c Wed Jun 22 19:23:18 2022
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_227.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_227.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_227.c"
-// Test for message: const object %s should have initializer [227]
+// Test for message: const object '%s' should have initializer [227]
/* expect+2: warning: static variable 'without_initializer' unused [226] */
-/* expect+1: warning: const object without_initializer should have initializer [227] */
+/* expect+1: warning: const object 'without_initializer' should have initializer [227] */
static const int without_initializer;
/* expect+1: warning: static variable 'with_initializer' unused [226] */
static const int with_initializer = 1;
Index: src/tests/usr.bin/xlint/lint1/msg_243.c
diff -u src/tests/usr.bin/xlint/lint1/msg_243.c:1.3 src/tests/usr.bin/xlint/lint1/msg_243.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_243.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_243.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_243.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_243.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_243.c"
-// Test for message: dubious comparison of enums, op %s [243]
+// Test for message: dubious comparison of enums, op '%s' [243]
/* lint1-extra-flags: -eP */
@@ -16,13 +16,13 @@ void eval(_Bool);
void
example(enum color a, enum color b)
{
- /* expect+1: warning: dubious comparison of enums, op < [243] */
+ /* expect+1: warning: dubious comparison of enums, op '<' [243] */
eval(a < b);
- /* expect+1: warning: dubious comparison of enums, op <= [243] */
+ /* expect+1: warning: dubious comparison of enums, op '<=' [243] */
eval(a <= b);
- /* expect+1: warning: dubious comparison of enums, op > [243] */
+ /* expect+1: warning: dubious comparison of enums, op '>' [243] */
eval(a > b);
- /* expect+1: warning: dubious comparison of enums, op >= [243] */
+ /* expect+1: warning: dubious comparison of enums, op '>=' [243] */
eval(a >= b);
eval(a == b);
eval(a != b);
Index: src/tests/usr.bin/xlint/lint1/msg_246.c
diff -u src/tests/usr.bin/xlint/lint1/msg_246.c:1.3 src/tests/usr.bin/xlint/lint1/msg_246.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_246.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_246.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_246.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_246.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_246.c"
// Test for message: dubious conversion of enum to '%s' [246]
@@ -17,6 +17,6 @@ to_double(enum color c)
void *
to_pointer(enum color c)
{
- /* expect+1: warning: illegal combination of pointer (pointer to void) and integer (enum color) [183] */
+ /* expect+1: warning: illegal combination of pointer 'pointer to void' and integer 'enum color' [183] */
return c;
}
Index: src/tests/usr.bin/xlint/lint1/msg_258.c
diff -u src/tests/usr.bin/xlint/lint1/msg_258.c:1.3 src/tests/usr.bin/xlint/lint1/msg_258.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_258.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_258.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_258.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_258.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_258.c"
// Test for message: unterminated string constant [258]
@@ -12,5 +12,5 @@ int dummy;
/* expect+4: error: unterminated string constant [258] */
/* expect+3: error: syntax error '' [249] */
-/* expect+2: error: empty array declaration: str [190] */
+/* expect+2: error: empty array declaration for 'str' [190] */
const char str[] = "This is the end.
Index: src/tests/usr.bin/xlint/lint1/msg_276.c
diff -u src/tests/usr.bin/xlint/lint1/msg_276.c:1.3 src/tests/usr.bin/xlint/lint1/msg_276.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_276.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_276.c Wed Jun 22 19:23:18 2022
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_276.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_276.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_276.c"
-// Test for message: __%s__ is illegal for type %s [276]
+// Test for message: '__%s__' is illegal for type '%s' [276]
-/* expect+1: error: __real__ is illegal for type double [276] */
+/* expect+1: error: '__real__' is illegal for type 'double' [276] */
int real_int = __real__ 0.0;
-/* expect+1: error: __imag__ is illegal for type double [276] */
+/* expect+1: error: '__imag__' is illegal for type 'double' [276] */
int imag_int = __imag__ 0.0;
Index: src/tests/usr.bin/xlint/lint1/msg_281.c
diff -u src/tests/usr.bin/xlint/lint1/msg_281.c:1.3 src/tests/usr.bin/xlint/lint1/msg_281.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_281.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_281.c Wed Jun 22 19:23:18 2022
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_281.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_281.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_281.c"
-// Test for message: duplicate use of /* %s */ [281]
+// Test for message: duplicate comment /* %s */ [281]
-/* expect+1: warning: duplicate use of ** ARGSUSED ** [281] */
+/* expect+1: warning: duplicate comment ** ARGSUSED ** [281] */
/* ARGSUSED *//* ARGSUSED */
void args_used(int x)
{
Index: src/tests/usr.bin/xlint/lint1/msg_282.c
diff -u src/tests/usr.bin/xlint/lint1/msg_282.c:1.3 src/tests/usr.bin/xlint/lint1/msg_282.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_282.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_282.c Wed Jun 22 19:23:18 2022
@@ -1,20 +1,20 @@
-/* $NetBSD: msg_282.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_282.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_282.c"
-// Test for message: must precede function definition: /* %s */ [282]
+// Test for message: comment /* %s */ must precede function definition [282]
-/* expect+1: warning: must precede function definition: ** ARGSUSED ** [282] */
+/* expect+1: warning: comment ** ARGSUSED ** must precede function definition [282] */
/* ARGSUSED */
int argsused;
-/* expect+1: warning: must precede function definition: ** VARARGS ** [282] */
+/* expect+1: warning: comment ** VARARGS ** must precede function definition [282] */
/* VARARGS */
int varargs;
-/* expect+1: warning: must precede function definition: ** PRINTFLIKE ** [282] */
+/* expect+1: warning: comment ** PRINTFLIKE ** must precede function definition [282] */
/* PRINTFLIKE */
int printflike;
-/* expect+1: warning: must precede function definition: ** SCANFLIKE ** [282] */
+/* expect+1: warning: comment ** SCANFLIKE ** must precede function definition [282] */
/* SCANFLIKE */
int scanflike;
Index: src/tests/usr.bin/xlint/lint1/msg_290.c
diff -u src/tests/usr.bin/xlint/lint1/msg_290.c:1.3 src/tests/usr.bin/xlint/lint1/msg_290.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_290.c:1.3 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_290.c Wed Jun 22 19:23:18 2022
@@ -1,15 +1,15 @@
-/* $NetBSD: msg_290.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_290.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_290.c"
-// Test for message: static function %s declared but not defined [290]
+// Test for message: static function '%s' declared but not defined [290]
-/* expect+1: warning: static function only_declared declared but not defined [290] */
+/* expect+1: warning: static function 'only_declared' declared but not defined [290] */
static void only_declared(void);
static void declared_and_called(void);
void
use_function(void)
{
- /* expect+1: error: static function called but not defined: declared_and_called() [225] */
+ /* expect+1: error: static function 'declared_and_called' called but not defined [225] */
declared_and_called();
}
Index: src/tests/usr.bin/xlint/lint1/msg_302.c
diff -u src/tests/usr.bin/xlint/lint1/msg_302.c:1.3 src/tests/usr.bin/xlint/lint1/msg_302.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_302.c:1.3 Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_302.c Wed Jun 22 19:23:18 2022
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_302.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */
+/* $NetBSD: msg_302.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_302.c"
-// Test for message: %s returns pointer to automatic object [302]
+// Test for message: '%s' returns pointer to automatic object [302]
void *
return_arg(int arg)
{
- /* expect+1: warning: return_arg returns pointer to automatic object [302] */
+ /* expect+1: warning: 'return_arg' returns pointer to automatic object [302] */
return &arg;
}
@@ -14,7 +14,7 @@ void *
return_local(void)
{
int local = 3;
- /* expect+1: warning: return_local returns pointer to automatic object [302] */
+ /* expect+1: warning: 'return_local' returns pointer to automatic object [302] */
return &local;
}
@@ -28,7 +28,7 @@ return_local_array(_Bool cond)
if (cond)
return p;
- /* expect+1: warning: return_local_array returns pointer to automatic object [302] */
+ /* expect+1: warning: 'return_local_array' returns pointer to automatic object [302] */
return local + 5;
}
Index: src/tests/usr.bin/xlint/lint1/msg_306.c
diff -u src/tests/usr.bin/xlint/lint1/msg_306.c:1.3 src/tests/usr.bin/xlint/lint1/msg_306.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_306.c:1.3 Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_306.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_306.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */
+/* $NetBSD: msg_306.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_306.c"
-// Test for message: constant truncated by conversion, op %s [306]
+// Test for message: constant truncated by conversion, op '%s' [306]
unsigned char
to_u8(void)
@@ -20,7 +20,7 @@ and_u8(unsigned char a)
unsigned char
or_u8(unsigned char a)
{
- /* expect+1: warning: constant truncated by conversion, op |= [306] */
+ /* expect+1: warning: constant truncated by conversion, op '|=' [306] */
a |= 0x1234;
/* XXX: Lint doesn't care about the expanded form of the same code. */
Index: src/tests/usr.bin/xlint/lint1/msg_326.c
diff -u src/tests/usr.bin/xlint/lint1/msg_326.c:1.3 src/tests/usr.bin/xlint/lint1/msg_326.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_326.c:1.3 Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_326.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_326.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */
+/* $NetBSD: msg_326.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_326.c"
-// Test for message: %s attribute ignored for %s [326]
+// Test for message: attribute '%s' ignored for '%s' [326]
-/* expect+1: warning: packed attribute ignored for int [326] */
+/* expect+1: warning: attribute 'packed' ignored for 'int' [326] */
int variable __packed;
Index: src/tests/usr.bin/xlint/lint1/init_braces.c
diff -u src/tests/usr.bin/xlint/lint1/init_braces.c:1.1 src/tests/usr.bin/xlint/lint1/init_braces.c:1.2
--- src/tests/usr.bin/xlint/lint1/init_braces.c:1.1 Mon Dec 20 19:48:05 2021
+++ src/tests/usr.bin/xlint/lint1/init_braces.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: init_braces.c,v 1.1 2021/12/20 19:48:05 rillig Exp $ */
+/* $NetBSD: init_braces.c,v 1.2 2022/06/22 19:23:18 rillig Exp $ */
# 3 "init_braces.c"
/*
@@ -15,7 +15,7 @@ init_int(void)
/* gcc-expect+2: error: invalid initializer */
/* clang-expect+1: error: array initializer must be an initializer list */
/* expect+2: error: {}-enclosed initializer required [181] */
- /* expect+1: error: empty array declaration: num0 [190] */
+ /* expect+1: error: empty array declaration for 'num0' [190] */
int num0[] = 0;
int num1[] = { 1 };
/* gcc-expect+2: warning: braces around scalar initializer */
@@ -42,14 +42,14 @@ init_string(void)
/* gcc-expect+4: warning: initialization of 'char' from 'char *' makes integer from pointer without a cast */
/* clang-expect+3: warning: incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [1]' */
/* clang-expect+2: warning: braces around scalar initializer */
- /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to char) [183] */
+ /* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to char' [183] */
char name2[] = {{ "" }};
/* gcc-expect+6: warning: braces around scalar initializer */
/* gcc-expect+5: warning: braces around scalar initializer */
/* gcc-expect+4: warning: initialization of 'char' from 'char *' makes integer from pointer without a cast */
/* clang-expect+3: warning: too many braces around scalar initializer */
/* clang-expect+2: warning: incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [1]' */
- /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to char) [183] */
+ /* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to char' [183] */
char name3[] = {{{ "" }}};
/* gcc-expect+8: warning: braces around scalar initializer */
/* gcc-expect+7: warning: braces around scalar initializer */
@@ -58,6 +58,6 @@ init_string(void)
/* clang-expect+4: warning: too many braces around scalar initializer */
/* clang-expect+3: warning: too many braces around scalar initializer */
/* clang-expect+2: warning: incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [1]' */
- /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to char) [183] */
+ /* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to char' [183] */
char name4[] = {{{{ "" }}}};
}
Index: src/tests/usr.bin/xlint/lint1/msg_142.c
diff -u src/tests/usr.bin/xlint/lint1/msg_142.c:1.6 src/tests/usr.bin/xlint/lint1/msg_142.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_142.c:1.6 Sat Aug 21 11:50:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_142.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_142.c,v 1.6 2021/08/21 11:50:57 rillig Exp $ */
+/* $NetBSD: msg_142.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_142.c"
-// Test for message: floating point overflow detected, op %s [142]
+// Test for message: floating point overflow on operator '%s' [142]
/* lint1-only-if: ldbl-64 */
/*
@@ -9,6 +9,6 @@
* multipliers is needed to produce an overflow.
*/
-/* expect+2: warning: floating point overflow detected, op * [142] */
-/* expect+1: warning: floating point overflow detected, op * [142] */
+/* expect+2: warning: floating point overflow on operator '*' [142] */
+/* expect+1: warning: floating point overflow on operator '*' [142] */
double dbl = 1e100 * 1e100 * 1e100 * 1e100 * 1e100;
Index: src/tests/usr.bin/xlint/lint1/msg_156.c
diff -u src/tests/usr.bin/xlint/lint1/msg_156.c:1.6 src/tests/usr.bin/xlint/lint1/msg_156.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_156.c:1.6 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_156.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_156.c,v 1.6 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_156.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_156.c"
-// Test for message: enum type mismatch, arg #%d (%s != %s) [156]
+// Test for message: function expects '%s', passing '%s' for arg #%d [156]
enum color {
RED = 1 << 0,
@@ -23,8 +23,8 @@ example(enum color c, enum size s)
print_color(GREEN);
print_color(c);
- /* expect+1: warning: enum type mismatch, arg #1 (enum color != enum size) [156] */
+ /* expect+1: warning: function expects 'enum color', passing 'enum size' for arg #1 [156] */
print_color(MEDIUM);
- /* expect+1: warning: enum type mismatch, arg #1 (enum color != enum size) [156] */
+ /* expect+1: warning: function expects 'enum color', passing 'enum size' for arg #1 [156] */
print_color(s);
}
Index: src/tests/usr.bin/xlint/lint1/msg_162.c
diff -u src/tests/usr.bin/xlint/lint1/msg_162.c:1.6 src/tests/usr.bin/xlint/lint1/msg_162.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_162.c:1.6 Sun Sep 5 17:49:55 2021
+++ src/tests/usr.bin/xlint/lint1/msg_162.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_162.c,v 1.6 2021/09/05 17:49:55 rillig Exp $ */
+/* $NetBSD: msg_162.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_162.c"
-// Test for message: comparison of %s with %s, op %s [162]
+// Test for message: operator '%s' compares '%s' with '%s' [162]
/* lint1-extra-flags: -hp */
@@ -11,15 +11,15 @@ left_unsigned(unsigned int ui)
if (ui < -5.0) {
}
- /* expect+1: warning: comparison of unsigned int with negative constant, op < [162] */
+ /* expect+1: warning: operator '<' compares 'unsigned int' with 'negative constant' [162] */
if (ui < -5) {
}
- /* expect+1: warning: comparison of unsigned int with 0, op < [162] */
+ /* expect+1: warning: operator '<' compares 'unsigned int' with '0' [162] */
if (ui < 0) {
}
- /* expect+1: warning: comparison of unsigned int with 0, op >= [162] */
+ /* expect+1: warning: operator '>=' compares 'unsigned int' with '0' [162] */
if (ui >= 0) {
}
@@ -35,15 +35,15 @@ right_unsigned(unsigned int ui)
if (-5.0 > ui) {
}
- /* expect+1: warning: comparison of negative constant with unsigned int, op > [162] */
+ /* expect+1: warning: operator '>' compares 'negative constant' with 'unsigned int' [162] */
if (-5 > ui) {
}
- /* expect+1: warning: comparison of 0 with unsigned int, op > [162] */
+ /* expect+1: warning: operator '>' compares '0' with 'unsigned int' [162] */
if (0 > ui) {
}
- /* expect+1: warning: comparison of 0 with unsigned int, op <= [162] */
+ /* expect+1: warning: operator '<=' compares '0' with 'unsigned int' [162] */
if (0 <= ui) {
}
@@ -72,7 +72,7 @@ compare_signed_char(signed char sc)
void
compare_unsigned_char(unsigned char uc)
{
- /* expect+1: warning: comparison of unsigned char with negative constant, op == [162] */
+ /* expect+1: warning: operator '==' compares 'unsigned char' with 'negative constant' [162] */
if (uc == -1)
return;
if (uc == 0)
@@ -88,13 +88,13 @@ void take_bool(_Bool);
void
compare_operators(unsigned int x)
{
- /* expect+1: warning: comparison of unsigned int with negative constant, op < [162] */
+ /* expect+1: warning: operator '<' compares 'unsigned int' with 'negative constant' [162] */
take_bool(x < -1);
- /* expect+1: warning: comparison of unsigned int with 0, op < [162] */
+ /* expect+1: warning: operator '<' compares 'unsigned int' with '0' [162] */
take_bool(x < 0);
take_bool(x < 1);
- /* expect+1: warning: comparison of unsigned int with negative constant, op <= [162] */
+ /* expect+1: warning: operator '<=' compares 'unsigned int' with 'negative constant' [162] */
take_bool(x <= -1);
/*
* Before tree.c 1.379 from 2021-09-05, lint warned about
@@ -112,23 +112,23 @@ compare_operators(unsigned int x)
take_bool(x <= 0);
take_bool(x <= 1);
- /* expect+1: warning: comparison of unsigned int with negative constant, op > [162] */
+ /* expect+1: warning: operator '>' compares 'unsigned int' with 'negative constant' [162] */
take_bool(x > -1);
take_bool(x > 0);
take_bool(x > 1);
- /* expect+1: warning: comparison of unsigned int with negative constant, op >= [162] */
+ /* expect+1: warning: operator '>=' compares 'unsigned int' with 'negative constant' [162] */
take_bool(x >= -1);
- /* expect+1: warning: comparison of unsigned int with 0, op >= [162] */
+ /* expect+1: warning: operator '>=' compares 'unsigned int' with '0' [162] */
take_bool(x >= 0);
take_bool(x >= 1);
- /* expect+1: warning: comparison of unsigned int with negative constant, op == [162] */
+ /* expect+1: warning: operator '==' compares 'unsigned int' with 'negative constant' [162] */
take_bool(x == -1);
take_bool(x == 0);
take_bool(x == 1);
- /* expect+1: warning: comparison of unsigned int with negative constant, op != [162] */
+ /* expect+1: warning: operator '!=' compares 'unsigned int' with 'negative constant' [162] */
take_bool(x != -1);
take_bool(x != 0);
take_bool(x != 1);
Index: src/tests/usr.bin/xlint/lint1/msg_324.c
diff -u src/tests/usr.bin/xlint/lint1/msg_324.c:1.6 src/tests/usr.bin/xlint/lint1/msg_324.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_324.c:1.6 Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_324.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_324.c,v 1.6 2022/06/17 06:59:16 rillig Exp $ */
+/* $NetBSD: msg_324.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_324.c"
-// Test for message: suggest cast from '%s' to '%s' on op %s to avoid overflow [324]
+// Test for message: suggest cast from '%s' to '%s' on op '%s' to avoid overflow [324]
/*
* This warning applies to binary operators if the result of the operator
@@ -22,19 +22,19 @@ example(char c, int i, unsigned u)
long long ll;
unsigned long long ull;
- /* expect+1: warning: suggest cast from 'int' to 'long long' on op + to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'int' to 'long long' on op '+' to avoid overflow [324] */
ll = c + i;
- /* expect+1: warning: suggest cast from 'int' to 'long long' on op - to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'int' to 'long long' on op '-' to avoid overflow [324] */
ll = i - c;
- /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op * to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '*' to avoid overflow [324] */
ull = c * u;
- /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op + to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '+' to avoid overflow [324] */
ull = u + c;
- /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op - to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '-' to avoid overflow [324] */
ull = i - u;
- /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op * to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '*' to avoid overflow [324] */
ull = u * i;
- /* expect+1: warning: suggest cast from 'int' to 'long long' on op << to avoid overflow [324] */
+ /* expect+1: warning: suggest cast from 'int' to 'long long' on op '<<' to avoid overflow [324] */
ll = i << c;
/*
Index: src/tests/usr.bin/xlint/lint1/msg_346.c
diff -u src/tests/usr.bin/xlint/lint1/msg_346.c:1.6 src/tests/usr.bin/xlint/lint1/msg_346.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_346.c:1.6 Sat Oct 9 20:03:20 2021
+++ src/tests/usr.bin/xlint/lint1/msg_346.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_346.c,v 1.6 2021/10/09 20:03:20 rillig Exp $ */
+/* $NetBSD: msg_346.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_346.c"
// Test for message: call to '%s' effectively discards 'const' from argument [346]
@@ -54,9 +54,9 @@ all_functions(void)
void
edge_cases(void)
-{
+{ /* TODO: '0 argument passed' is not correct English */
/* No arguments, to cover the 'an == NULL' in is_first_arg_const. */
- /* expect+1: error: argument mismatch: 0 arg passed, 2 expected [150] */
+ /* expect+1: error: argument mismatch: 0 argument passed, 2 expected [150] */
take_char_ptr(strchr());
}
Index: src/tests/usr.bin/xlint/lint1/msg_230_uchar.c
diff -u src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.8 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.9
--- src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.8 Mon Mar 14 20:25:26 2022
+++ src/tests/usr.bin/xlint/lint1/msg_230_uchar.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_230_uchar.c,v 1.8 2022/03/14 20:25:26 rillig Exp $ */
+/* $NetBSD: msg_230_uchar.c,v 1.9 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_230_uchar.c"
// Test for message: nonportable character comparison '%s %d' [230]
@@ -95,7 +95,7 @@ compare_greater(char c)
* behaves differently depending on the platform. Such a comparison
* should never be needed.
*/
- /* expect+1: warning: comparison of char with 0, op >= [162] */
+ /* expect+1: warning: operator '>=' compares 'char' with '0' [162] */
if (c >= 0)
return;
Index: src/tests/usr.bin/xlint/lint1/msg_241.c
diff -u src/tests/usr.bin/xlint/lint1/msg_241.c:1.8 src/tests/usr.bin/xlint/lint1/msg_241.c:1.9
--- src/tests/usr.bin/xlint/lint1/msg_241.c:1.8 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_241.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_241.c,v 1.8 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_241.c,v 1.9 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_241.c"
-// Test for message: dubious operation on enum, op %s [241]
+// Test for message: dubious operation on enum, op '%s' [241]
//
// As of February 2021, the option -e is not enabled by default in
// share/mk/sys.mk, therefore this message is neither well-known nor
@@ -27,35 +27,35 @@ example(void)
{
enum color c = RED;
- /* expect+1: warning: dubious operation on enum, op ! [241] */
+ /* expect+1: warning: dubious operation on enum, op '!' [241] */
sink_bool(!c);
- /* expect+1: warning: dubious operation on enum, op ~ [241] */
+ /* expect+1: warning: dubious operation on enum, op '~' [241] */
sink_color(~c);
- /* expect+1: warning: dubious operation on enum, op ++x [241] */
+ /* expect+1: warning: dubious operation on enum, op '++x' [241] */
++c;
- /* expect+1: warning: dubious operation on enum, op --x [241] */
+ /* expect+1: warning: dubious operation on enum, op '--x' [241] */
--c;
- /* expect+1: warning: dubious operation on enum, op x++ [241] */
+ /* expect+1: warning: dubious operation on enum, op 'x++' [241] */
c++;
- /* expect+1: warning: dubious operation on enum, op x-- [241] */
+ /* expect+1: warning: dubious operation on enum, op 'x--' [241] */
c--;
- /* expect+1: warning: dubious operation on enum, op + [241] */
+ /* expect+1: warning: dubious operation on enum, op '+' [241] */
sink_color(+c);
- /* expect+1: warning: dubious operation on enum, op - [241] */
+ /* expect+1: warning: dubious operation on enum, op '-' [241] */
sink_color(-c);
- /* expect+1: warning: dubious operation on enum, op * [241] */
+ /* expect+1: warning: dubious operation on enum, op '*' [241] */
sink_color(c * c);
- /* expect+1: warning: dubious operation on enum, op / [241] */
+ /* expect+1: warning: dubious operation on enum, op '/' [241] */
sink_color(c / c);
- /* expect+1: warning: dubious operation on enum, op % [241] */
+ /* expect+1: warning: dubious operation on enum, op '%' [241] */
sink_color(c % c);
- /* expect+1: warning: dubious operation on enum, op + [241] */
+ /* expect+1: warning: dubious operation on enum, op '+' [241] */
sink_color(c + c);
- /* expect+1: warning: dubious operation on enum, op - [241] */
+ /* expect+1: warning: dubious operation on enum, op '-' [241] */
sink_color(c - c);
- /* expect+1: warning: dubious operation on enum, op << [241] */
+ /* expect+1: warning: dubious operation on enum, op '<<' [241] */
sink_color(c << c);
- /* expect+1: warning: dubious operation on enum, op >> [241] */
+ /* expect+1: warning: dubious operation on enum, op '>>' [241] */
sink_color(c >> c);
sink_bool(c < c);
@@ -65,51 +65,51 @@ example(void)
sink_bool(c == c);
sink_bool(c != c);
- /* expect+1: warning: dubious operation on enum, op & [241] */
+ /* expect+1: warning: dubious operation on enum, op '&' [241] */
sink_color(c & c);
- /* expect+1: warning: dubious operation on enum, op ^ [241] */
+ /* expect+1: warning: dubious operation on enum, op '^' [241] */
sink_color(c ^ c);
- /* expect+1: warning: dubious operation on enum, op | [241] */
+ /* expect+1: warning: dubious operation on enum, op '|' [241] */
sink_color(c | c);
- /* expect+1: warning: dubious operation on enum, op && [241] */
+ /* expect+1: warning: dubious operation on enum, op '&&' [241] */
sink_bool(c && c);
- /* expect+1: warning: dubious operation on enum, op || [241] */
+ /* expect+1: warning: dubious operation on enum, op '||' [241] */
sink_bool(c || c);
sink_color(c ? c : BLUE);
c = GREEN;
- /* expect+1: warning: dubious operation on enum, op *= [241] */
+ /* expect+1: warning: dubious operation on enum, op '*=' [241] */
c *= c;
- /* expect+1: warning: dubious operation on enum, op /= [241] */
+ /* expect+1: warning: dubious operation on enum, op '/=' [241] */
c /= c;
- /* expect+1: warning: dubious operation on enum, op %= [241] */
+ /* expect+1: warning: dubious operation on enum, op '%=' [241] */
c %= c;
- /* expect+1: warning: dubious operation on enum, op += [241] */
+ /* expect+1: warning: dubious operation on enum, op '+=' [241] */
c += c;
- /* expect+1: warning: dubious operation on enum, op -= [241] */
+ /* expect+1: warning: dubious operation on enum, op '-=' [241] */
c -= c;
- /* expect+1: warning: dubious operation on enum, op <<= [241] */
+ /* expect+1: warning: dubious operation on enum, op '<<=' [241] */
c <<= c;
- /* expect+1: warning: dubious operation on enum, op >>= [241] */
+ /* expect+1: warning: dubious operation on enum, op '>>=' [241] */
c >>= c;
- /* expect+1: warning: dubious operation on enum, op &= [241] */
+ /* expect+1: warning: dubious operation on enum, op '&=' [241] */
c &= c;
- /* expect+1: warning: dubious operation on enum, op ^= [241] */
+ /* expect+1: warning: dubious operation on enum, op '^=' [241] */
c ^= c;
- /* expect+1: warning: dubious operation on enum, op |= [241] */
+ /* expect+1: warning: dubious operation on enum, op '|=' [241] */
c |= c;
/* The cast to unsigned is required by GCC at WARNS=6. */
- /* expect+1: warning: dubious operation on enum, op &= [241] */
+ /* expect+1: warning: dubious operation on enum, op '&=' [241] */
c &= ~(unsigned)GREEN;
}
void
cover_typeok_enum(enum color c, int i)
{
- /* expect+2: warning: dubious operation on enum, op * [241] */
- /* expect+1: warning: combination of 'enum color' and 'int', op > [242] */
+ /* expect+2: warning: dubious operation on enum, op '*' [241] */
+ /* expect+1: warning: combination of 'enum color' and 'int', op '>' [242] */
if (c * i > 5)
return;
}
Index: src/tests/usr.bin/xlint/lint1/msg_242.c
diff -u src/tests/usr.bin/xlint/lint1/msg_242.c:1.5 src/tests/usr.bin/xlint/lint1/msg_242.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_242.c:1.5 Mon Nov 29 23:58:06 2021
+++ src/tests/usr.bin/xlint/lint1/msg_242.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_242.c,v 1.5 2021/11/29 23:58:06 rillig Exp $ */
+/* $NetBSD: msg_242.c,v 1.6 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_242.c"
-// Test for message: combination of '%s' and '%s', op %s [242]
+// Test for message: combination of '%s' and '%s', op '%s' [242]
/* lint1-extra-flags: -e */
@@ -22,9 +22,9 @@ example(enum E e, int i)
int i2 = e;
int i3 = i;
- /* expect+1: warning: combination of 'enum E' and 'int', op = [242] */
+ /* expect+1: warning: combination of 'enum E' and 'int', op '=' [242] */
e3 = i;
- /* expect+1: warning: combination of 'int' and 'enum E', op = [242] */
+ /* expect+1: warning: combination of 'int' and 'enum E', op '=' [242] */
i2 = e;
sink_enum(e2);
@@ -49,9 +49,9 @@ unnamed_enum(void)
unsigned i = 3;
- /* expect+3: warning: dubious operation on enum, op * [241] */
+ /* expect+3: warning: dubious operation on enum, op '*' [241] */
/* FIXME: Combining 'unsigned int' with 'unsigned int' is OK. */
- /* expect+1: warning: combination of 'unsigned int' and 'unsigned int', op = [242] */
+ /* expect+1: warning: combination of 'unsigned int' and 'unsigned int', op '=' [242] */
i = compile_time_constant * i;
return i;
}
Index: src/tests/usr.bin/xlint/lint1/msg_280.c
diff -u src/tests/usr.bin/xlint/lint1/msg_280.c:1.5 src/tests/usr.bin/xlint/lint1/msg_280.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_280.c:1.5 Sun Sep 5 19:16:37 2021
+++ src/tests/usr.bin/xlint/lint1/msg_280.c Wed Jun 22 19:23:18 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_280.c,v 1.5 2021/09/05 19:16:37 rillig Exp $ */
+/* $NetBSD: msg_280.c,v 1.6 2022/06/22 19:23:18 rillig Exp $ */
# 3 "msg_280.c"
-// Test for message: must be outside function: /* %s */ [280]
+// Test for message: comment /* %s */ must be outside function [280]
/* VARARGS */
void
@@ -36,7 +36,7 @@ varargs_bad_param(/* VARARGS */ const ch
}
void
-/* expect+1: warning: must be outside function: ** VARARGS ** [280] */
+/* expect+1: warning: comment ** VARARGS ** must be outside function [280] */
varargs_bad_ellipsis(const char *str, /* VARARGS */ ...)
{
(void)str;
@@ -45,7 +45,7 @@ varargs_bad_ellipsis(const char *str, /*
void
varargs_bad_body(const char *str, ...)
{
- /* expect+1: warning: must be outside function: ** VARARGS ** [280] */
+ /* expect+1: warning: comment ** VARARGS ** must be outside function [280] */
/* VARARGS */
(void)str;
}
@@ -54,14 +54,14 @@ void
/* expect+1: warning: argument 'str' unused in function 'argsused_bad_body' [231] */
argsused_bad_body(const char *str)
{
- /* expect+1: warning: must be outside function: ** ARGSUSED ** [280] */
+ /* expect+1: warning: comment ** ARGSUSED ** must be outside function [280] */
/* ARGSUSED */
}
void
printflike_bad_body(const char *fmt, ...)
{
- /* expect+1: warning: must be outside function: ** PRINTFLIKE ** [280] */
+ /* expect+1: warning: comment ** PRINTFLIKE ** must be outside function [280] */
/* PRINTFLIKE */
(void)fmt;
}
@@ -69,7 +69,7 @@ printflike_bad_body(const char *fmt, ...
void
scanflike_bad_body(const char *fmt, ...)
{
- /* expect+1: warning: must be outside function: ** SCANFLIKE ** [280] */
+ /* expect+1: warning: comment ** SCANFLIKE ** must be outside function [280] */
/* SCANFLIKE */
(void)fmt;
}
Index: src/usr.bin/xlint/lint1/ckbool.c
diff -u src/usr.bin/xlint/lint1/ckbool.c:1.18 src/usr.bin/xlint/lint1/ckbool.c:1.19
--- src/usr.bin/xlint/lint1/ckbool.c:1.18 Sun Jun 19 12:14:33 2022
+++ src/usr.bin/xlint/lint1/ckbool.c Wed Jun 22 19:23:17 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ckbool.c,v 1.18 2022/06/19 12:14:33 rillig Exp $ */
+/* $NetBSD: ckbool.c,v 1.19 2022/06/22 19:23:17 rillig Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: ckbool.c,v 1.18 2022/06/19 12:14:33 rillig Exp $");
+__RCSID("$NetBSD: ckbool.c,v 1.19 2022/06/22 19:23:17 rillig Exp $");
#endif
#include <string.h>
@@ -123,7 +123,7 @@ typeok_strict_bool_binary_compatible(op_
/* argument #%d expects '%s', gets passed '%s' */
error(334, arg, tspec_name(lt), tspec_name(rt));
} else if (op == RETURN) {
- /* return value type mismatch (%s) and (%s) */
+ /* function has return type '%s' but returns '%s' */
error(211, tspec_name(lt), tspec_name(rt));
} else {
/* operands of '%s' have incompatible types '%s' and '%s' */
Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.292 src/usr.bin/xlint/lint1/decl.c:1.293
--- src/usr.bin/xlint/lint1/decl.c:1.292 Tue Jun 21 22:10:30 2022
+++ src/usr.bin/xlint/lint1/decl.c Wed Jun 22 19:23:17 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.292 2022/06/21 22:10:30 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.293 2022/06/22 19:23:17 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.292 2022/06/21 22:10:30 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.293 2022/06/22 19:23:17 rillig Exp $");
#endif
#include <sys/param.h>
@@ -512,7 +512,7 @@ setpackedsize(type_t *tp)
}
break;
default:
- /* %s attribute ignored for %s */
+ /* attribute '%s' ignored for '%s' */
warning(326, "packed", type_name(tp));
break;
}
@@ -1869,8 +1869,8 @@ complete_tag_struct_or_union(type_t *tp,
}
if (n == 0 && sp->sou_size_in_bits != 0) {
- /* %s has no named members */
- warning(65, t == STRUCT ? "structure" : "union");
+ /* '%s' has no named members */
+ warning(65, type_name(tp));
}
return tp;
}
@@ -2528,24 +2528,24 @@ check_func_lint_directives(void)
for (arg = dcs->d_func_args; arg != NULL; arg = arg->s_next)
narg++;
if (nargusg > narg) {
- /* argument number mismatch with directive: ** %s ** */
+ /* argument number mismatch with directive ** %s ** */
warning(283, "ARGSUSED");
nargusg = 0;
}
if (nvararg > narg) {
- /* argument number mismatch with directive: ** %s ** */
+ /* argument number mismatch with directive ** %s ** */
warning(283, "VARARGS");
nvararg = 0;
}
if (printflike_argnum > narg) {
- /* argument number mismatch with directive: ** %s ** */
+ /* argument number mismatch with directive ** %s ** */
warning(283, "PRINTFLIKE");
printflike_argnum = -1;
} else if (printflike_argnum == 0) {
printflike_argnum = -1;
}
if (scanflike_argnum > narg) {
- /* argument number mismatch with directive: ** %s ** */
+ /* argument number mismatch with directive ** %s ** */
warning(283, "SCANFLIKE");
scanflike_argnum = -1;
} else if (scanflike_argnum == 0) {
@@ -2988,10 +2988,10 @@ check_size(sym_t *dsym)
if (length_in_bits(dsym->s_type, dsym->s_name) == 0 &&
dsym->s_type->t_tspec == ARRAY && dsym->s_type->t_dim == 0) {
if (!allow_c90) {
- /* empty array declaration: %s */
+ /* empty array declaration for '%s' */
warning(190, dsym->s_name);
} else {
- /* empty array declaration: %s */
+ /* empty array declaration for '%s' */
error(190, dsym->s_name);
}
}
@@ -3245,7 +3245,7 @@ check_unused_static_global_variable(cons
/* static function '%s' unused */
warning_at(236, &sym->s_def_pos, sym->s_name);
} else {
- /* static function %s declared but not defined */
+ /* static function '%s' declared but not defined */
warning_at(290, &sym->s_def_pos, sym->s_name);
}
} else if (!sym->s_set) {
@@ -3261,7 +3261,7 @@ static void
check_static_global_variable(const sym_t *sym)
{
if (sym->s_type->t_tspec == FUNC && sym->s_used && sym->s_def != DEF) {
- /* static function called but not defined: %s() */
+ /* static function '%s' called but not defined */
error_at(225, &sym->s_use_pos, sym->s_name);
}
@@ -3269,7 +3269,7 @@ check_static_global_variable(const sym_t
check_unused_static_global_variable(sym);
if (allow_c90 && sym->s_def == TDEF && sym->s_type->t_const) {
- /* const object %s should have initializer */
+ /* const object '%s' should have initializer */
warning_at(227, &sym->s_def_pos, sym->s_name);
}
}
@@ -3321,10 +3321,10 @@ check_global_variable_size(const sym_t *
/* TODO: C99 6.7.5.2p1 defines this as an error as well. */
if (!allow_c90 ||
(sym->s_scl == EXTERN && (allow_trad || allow_c99))) {
- /* empty array declaration: %s */
+ /* empty array declaration for '%s' */
warning_at(190, &sym->s_def_pos, sym->s_name);
} else {
- /* empty array declaration: %s */
+ /* empty array declaration for '%s' */
error_at(190, &sym->s_def_pos, sym->s_name);
}
}
Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.175 src/usr.bin/xlint/lint1/err.c:1.176
--- src/usr.bin/xlint/lint1/err.c:1.175 Tue Jun 21 21:18:30 2022
+++ src/usr.bin/xlint/lint1/err.c Wed Jun 22 19:23:17 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.175 2022/06/21 21:18:30 rillig Exp $ */
+/* $NetBSD: err.c,v 1.176 2022/06/22 19:23:17 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: err.c,v 1.175 2022/06/21 21:18:30 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.176 2022/06/22 19:23:17 rillig Exp $");
#endif
#include <stdarg.h>
@@ -118,7 +118,7 @@ static const char *const msgs[] = {
"function prototype parameters must have types", /* 62 */
"prototype does not match old-style definition", /* 63 */
"()-less function definition", /* 64 */
- "%s has no named members", /* 65 */
+ "'%s' has no named members", /* 65 */
"", /* 66 */
"cannot return incomplete type", /* 67 */
"typedef already qualified with '%s'", /* 68 */
@@ -166,7 +166,7 @@ static const char *const msgs[] = {
"pointer to function is not allowed here", /* 110 */
"unacceptable operand of '%s'", /* 111 */
"cannot take address of bit-field", /* 112 */
- "cannot take address of register %s", /* 113 */
+ "cannot take address of register '%s'", /* 113 */
"%soperand of '%s' must be lvalue", /* 114 */
"%soperand of '%s' must be modifiable lvalue", /* 115 */
"illegal pointer subtraction", /* 116 */
@@ -181,7 +181,7 @@ static const char *const msgs[] = {
"ANSI C forbids ordered comparisons of pointers to functions",/* 125 */
"incompatible types '%s' and '%s' in conditional", /* 126 */
"'&' before array or function: ignored", /* 127 */
- "operands have incompatible pointer types, op %s (%s != %s)", /* 128 */
+ "operands of '%s' have incompatible pointer types to '%s' and '%s'", /* 128 */
"expression has null effect", /* 129 */
"enum type mismatch: '%s' '%s' '%s'", /* 130 */
"conversion to '%s' may sign-extend incorrectly", /* 131 */
@@ -190,32 +190,32 @@ static const char *const msgs[] = {
"conversion of pointer to '%s' may lose bits", /* 134 */
"converting '%s' to '%s' may cause alignment problem", /* 135 */
"cannot do pointer arithmetic on operand of unknown size", /* 136 */
- "use of incomplete enum type, op %s", /* 137 */
+ "", /* unused */ /* 137 */
"unknown operand size, op %s", /* 138 */
"division by 0", /* 139 */
"modulus by 0", /* 140 */
"integer overflow detected, op '%s'", /* 141 */
- "floating point overflow detected, op %s", /* 142 */
+ "floating point overflow on operator '%s'", /* 142 */
"cannot take size/alignment of incomplete type", /* 143 */
"cannot take size/alignment of function type '%s'", /* 144 */
"cannot take size/alignment of bit-field", /* 145 */
"cannot take size/alignment of void", /* 146 */
"invalid cast from '%s' to '%s'", /* 147 */
"improper cast of void expression", /* 148 */
- "illegal function (type %s)", /* 149 */
- "argument mismatch: %d arg%s passed, %d expected", /* 150 */
+ "cannot call '%s', must be a function", /* 149 */
+ "argument mismatch: %d %s passed, %d expected", /* 150 */
"void expressions may not be arguments, arg #%d", /* 151 */
"argument cannot have unknown size, arg #%d", /* 152 */
"converting '%s' to incompatible '%s' for argument %d", /* 153 */
- "illegal combination of %s (%s) and %s (%s), arg #%d", /* 154 */
+ "illegal combination of %s '%s' and %s '%s', arg #%d", /* 154 */
"passing '%s' to incompatible '%s', arg #%d", /* 155 */
- "enum type mismatch, arg #%d (%s != %s)", /* 156 */
+ "function expects '%s', passing '%s' for arg #%d", /* 156 */
"ANSI C treats constant as unsigned", /* 157 */
- "%s may be used before set", /* 158 */
+ "'%s' may be used before set", /* 158 */
"assignment in conditional context", /* 159 */
"operator '==' found where '=' was expected", /* 160 */
"constant in conditional context", /* 161 */
- "comparison of %s with %s, op %s", /* 162 */
+ "operator '%s' compares '%s' with '%s'", /* 162 */
"a cast does not yield an lvalue", /* 163 */
"assignment of negative constant to unsigned type", /* 164 */
"constant truncated by assignment", /* 165 */
@@ -235,19 +235,19 @@ static const char *const msgs[] = {
"cannot initialize struct/union with no named member", /* 179 */
"bit-field initializer does not fit", /* 180 */
"{}-enclosed initializer required", /* 181 */
- "incompatible pointer types (%s != %s)", /* 182 */
- "illegal combination of %s (%s) and %s (%s)", /* 183 */
+ "incompatible pointer types to '%s' and '%s'", /* 182 */
+ "illegal combination of %s '%s' and %s '%s'", /* 183 */
"illegal combination of '%s' and '%s'", /* 184 */
"cannot initialize '%s' from '%s'", /* 185 */
"bit-field initialization is illegal in traditional C", /* 186 */
"string literal too long (%lu) for target array (%lu)", /* 187 */
"no automatic aggregate initialization in traditional C", /* 188 */
"", /* no longer used */ /* 189 */
- "empty array declaration: %s", /* 190 */
+ "empty array declaration for '%s'", /* 190 */
"'%s' set but not used in function '%s'", /* 191 */
"'%s' unused in function '%s'", /* 192 */
"statement not reached", /* 193 */
- "label %s redefined", /* 194 */
+ "label '%s' redefined", /* 194 */
"case not in switch", /* 195 */
"case label affected by conversion", /* 196 */
"non-constant case expression", /* 197 */
@@ -264,23 +264,23 @@ static const char *const msgs[] = {
"break outside loop or switch", /* 208 */
"continue outside loop", /* 209 */
"enum type mismatch between '%s' and '%s' in initialization", /* 210 */
- "return value type mismatch (%s) and (%s)", /* 211 */
+ "function has return type '%s' but returns '%s'", /* 211 */
"cannot return incomplete type", /* 212 */
- "void function %s cannot return value", /* 213 */
+ "void function '%s' cannot return value", /* 213 */
"function '%s' expects to return value", /* 214 */
"function '%s' implicitly declared to return int", /* 215 */
- "function %s has return (e); and return;", /* 216 */
- "function %s falls off bottom without returning value", /* 217 */
- "ANSI C treats constant as unsigned, op %s", /* 218 */
+ "function '%s' has 'return expr' and 'return'", /* 216 */
+ "function '%s' falls off bottom without returning value", /* 217 */
+ "ANSI C treats constant as unsigned, op '%s'", /* 218 */
"concatenated strings are illegal in traditional C", /* 219 */
"fallthrough on case statement", /* 220 */
"initialization of unsigned with negative constant", /* 221 */
"conversion of negative constant to unsigned type", /* 222 */
"end-of-loop code not reached", /* 223 */
"cannot recover from previous errors", /* 224 */
- "static function called but not defined: %s()", /* 225 */
+ "static function '%s' called but not defined", /* 225 */
"static variable '%s' unused", /* 226 */
- "const object %s should have initializer", /* 227 */
+ "const object '%s' should have initializer", /* 227 */
"function cannot return const or volatile object", /* 228 */
"converting '%s' to '%s' is questionable", /* 229 */
"nonportable character comparison '%s %d'", /* 230 */
@@ -294,9 +294,9 @@ static const char *const msgs[] = {
"initialization of union is illegal in traditional C", /* 238 */
"constant argument to '!'", /* 239 */
"assignment of different structures (%s != %s)", /* 240 */
- "dubious operation on enum, op %s", /* 241 */
- "combination of '%s' and '%s', op %s", /* 242 */
- "dubious comparison of enums, op %s", /* 243 */
+ "dubious operation on enum, op '%s'", /* 241 */
+ "combination of '%s' and '%s', op '%s'", /* 242 */
+ "dubious comparison of enums, op '%s'", /* 243 */
"illegal structure pointer combination", /* 244 */
"incompatible structure pointers: '%s' '%s' '%s'", /* 245 */
"dubious conversion of enum to '%s'", /* 246 */
@@ -329,21 +329,21 @@ static const char *const msgs[] = {
"bit-field type '%s' invalid in ANSI C", /* 273 */
"ANSI C forbids comparison of %s with %s", /* 274 */
"cast discards 'const' from type '%s'", /* 275 */
- "__%s__ is illegal for type %s", /* 276 */
+ "'__%s__' is illegal for type '%s'", /* 276 */
"initialization of '%s' with '%s'", /* 277 */
"combination of '%s' and '%s', arg #%d", /* 278 */
"combination of '%s' and '%s' in return", /* 279 */
- "must be outside function: /* %s */", /* 280 */
- "duplicate use of /* %s */", /* 281 */
- "must precede function definition: /* %s */", /* 282 */
- "argument number mismatch with directive: /* %s */", /* 283 */
+ "comment /* %s */ must be outside function", /* 280 */
+ "duplicate comment /* %s */", /* 281 */
+ "comment /* %s */ must precede function definition", /* 282 */
+ "argument number mismatch with directive /* %s */", /* 283 */
"fallthrough on default statement", /* 284 */
"prototype declaration", /* 285 */
"function definition is not a prototype", /* 286 */
"function declaration is not a prototype", /* 287 */
"dubious use of /* VARARGS */ with /* %s */", /* 288 */
"can't be used together: /* PRINTFLIKE */ /* SCANFLIKE */", /* 289 */
- "static function %s declared but not defined", /* 290 */
+ "static function '%s' declared but not defined", /* 290 */
"invalid multibyte character", /* 291 */
"cannot concatenate wide and regular string literals", /* 292 */
"argument %d must be 'char *' for PRINTFLIKE/SCANFLIKE", /* 293 */
@@ -355,11 +355,11 @@ static const char *const msgs[] = {
"prototype does not match old style definition, arg #%d", /* 299 */
"old style definition", /* 300 */
"array of incomplete type", /* 301 */
- "%s returns pointer to automatic object", /* 302 */
+ "'%s' returns pointer to automatic object", /* 302 */
"ANSI C forbids conversion of %s to %s", /* 303 */
"ANSI C forbids conversion of %s to %s, arg #%d", /* 304 */
"ANSI C forbids conversion of %s to %s, op %s", /* 305 */
- "constant truncated by conversion, op %s", /* 306 */
+ "constant truncated by conversion, op '%s'", /* 306 */
"static variable '%s' set but not used", /* 307 */
"invalid type for _Complex", /* 308 */
"extra bits set to 0 in conversion of '%s' to '%s', op '%s'", /* 309 */
@@ -377,9 +377,9 @@ static const char *const msgs[] = {
"array initializer with designators is a C99 feature", /* 321 */
"zero sized array is a C99 extension", /* 322 */
"continue in 'do ... while (0)' loop", /* 323 */
- "suggest cast from '%s' to '%s' on op %s to avoid overflow", /* 324 */
+ "suggest cast from '%s' to '%s' on op '%s' to avoid overflow", /* 324 */
"variable declaration in for loop", /* 325 */
- "%s attribute ignored for %s", /* 326 */
+ "attribute '%s' ignored for '%s'", /* 326 */
"declarations after statements is a C99 feature", /* 327 */
"union cast is a GCC extension", /* 328 */
"type '%s' is not a member of '%s'", /* 329 */
Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.141 src/usr.bin/xlint/lint1/func.c:1.142
--- src/usr.bin/xlint/lint1/func.c:1.141 Mon Jun 20 21:13:35 2022
+++ src/usr.bin/xlint/lint1/func.c Wed Jun 22 19:23:17 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.141 2022/06/20 21:13:35 rillig Exp $ */
+/* $NetBSD: func.c,v 1.142 2022/06/22 19:23:17 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: func.c,v 1.141 2022/06/20 21:13:35 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.142 2022/06/22 19:23:17 rillig Exp $");
#endif
#include <stdlib.h>
@@ -366,7 +366,7 @@ check_missing_return_value(void)
if (allow_c99 && strcmp(funcsym->s_name, "main") == 0)
return;
- /* function %s falls off bottom without returning value */
+ /* function '%s' falls off bottom without returning value */
warning(217, funcsym->s_name);
}
@@ -391,7 +391,7 @@ funcend(void)
*/
if (cstmt->c_had_return_noval && cstmt->c_had_return_value &&
funcsym->s_return_type_implicit_int)
- /* function %s has return (e); and return; */
+ /* function '%s' has 'return expr' and 'return' */
warning(216, funcsym->s_name);
/* Print warnings for unused arguments */
@@ -439,7 +439,7 @@ named_label(sym_t *sym)
{
if (sym->s_set) {
- /* label %s redefined */
+ /* label '%s' redefined */
error(194, sym->s_name);
} else {
mark_as_set(sym);
@@ -1074,7 +1074,7 @@ do_return(bool sys, tnode_t *tn)
cs->c_had_return_noval = true;
if (tn != NULL && funcsym->s_type->t_subt->t_tspec == VOID) {
- /* void function %s cannot return value */
+ /* void function '%s' cannot return value */
error(213, funcsym->s_name);
expr_free_all();
tn = NULL;
@@ -1105,7 +1105,7 @@ do_return(bool sys, tnode_t *tn)
rn = rn->tn_left;
if (rn->tn_op == ADDR && rn->tn_left->tn_op == NAME &&
rn->tn_left->tn_sym->s_scl == AUTO) {
- /* %s returns pointer to automatic object */
+ /* '%s' returns pointer to automatic object */
warning(302, funcsym->s_name);
}
}
@@ -1131,21 +1131,21 @@ global_clean_up_decl(bool silent)
if (nargusg != -1) {
if (!silent) {
- /* must precede function definition: ** %s ** */
+ /* comment ** %s ** must precede function definition */
warning_at(282, &argsused_pos, "ARGSUSED");
}
nargusg = -1;
}
if (nvararg != -1) {
if (!silent) {
- /* must precede function definition: ** %s ** */
+ /* comment ** %s ** must precede function definition */
warning_at(282, &vapos, "VARARGS");
}
nvararg = -1;
}
if (printflike_argnum != -1) {
if (!silent) {
- /* must precede function definition: ** %s ** */
+ /* comment ** %s ** must precede function definition */
warning_at(282, &printflike_pos, "PRINTFLIKE");
}
printflike_argnum = -1;
@@ -1183,12 +1183,12 @@ argsused(int n)
n = 0;
if (dcs->d_kind != DK_EXTERN) {
- /* must be outside function: ** %s ** */
+ /* comment ** %s ** must be outside function */
warning(280, "ARGSUSED");
return;
}
if (nargusg != -1) {
- /* duplicate use of ** %s ** */
+ /* duplicate comment ** %s ** */
warning(281, "ARGSUSED");
}
nargusg = n;
@@ -1209,12 +1209,12 @@ varargs(int n)
n = 0;
if (dcs->d_kind != DK_EXTERN) {
- /* must be outside function: ** %s ** */
+ /* comment ** %s ** must be outside function */
warning(280, "VARARGS");
return;
}
if (nvararg != -1) {
- /* duplicate use of ** %s ** */
+ /* duplicate comment ** %s ** */
warning(281, "VARARGS");
}
nvararg = n;
@@ -1235,12 +1235,12 @@ printflike(int n)
n = 0;
if (dcs->d_kind != DK_EXTERN) {
- /* must be outside function: ** %s ** */
+ /* comment ** %s ** must be outside function */
warning(280, "PRINTFLIKE");
return;
}
if (printflike_argnum != -1) {
- /* duplicate use of ** %s ** */
+ /* duplicate comment ** %s ** */
warning(281, "PRINTFLIKE");
}
printflike_argnum = n;
@@ -1261,12 +1261,12 @@ scanflike(int n)
n = 0;
if (dcs->d_kind != DK_EXTERN) {
- /* must be outside function: ** %s ** */
+ /* comment ** %s ** must be outside function */
warning(280, "SCANFLIKE");
return;
}
if (scanflike_argnum != -1) {
- /* duplicate use of ** %s ** */
+ /* duplicate comment ** %s ** */
warning(281, "SCANFLIKE");
}
scanflike_argnum = n;
@@ -1316,7 +1316,7 @@ lintlib(int n)
{
if (dcs->d_kind != DK_EXTERN) {
- /* must be outside function: ** %s ** */
+ /* comment ** %s ** must be outside function */
warning(280, "LINTLIBRARY");
return;
}
@@ -1359,7 +1359,7 @@ protolib(int n)
{
if (dcs->d_kind != DK_EXTERN) {
- /* must be outside function: ** %s ** */
+ /* comment ** %s ** must be outside function */
warning(280, "PROTOLIB");
return;
}
Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.235 src/usr.bin/xlint/lint1/init.c:1.236
--- src/usr.bin/xlint/lint1/init.c:1.235 Fri May 20 21:18:55 2022
+++ src/usr.bin/xlint/lint1/init.c Wed Jun 22 19:23:17 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.235 2022/05/20 21:18:55 rillig Exp $ */
+/* $NetBSD: init.c,v 1.236 2022/06/22 19:23:17 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: init.c,v 1.235 2022/05/20 21:18:55 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.236 2022/06/22 19:23:17 rillig Exp $");
#endif
#include <stdlib.h>
@@ -824,7 +824,7 @@ initialization_rbrace(initialization *in
if (in->in_sym->s_type->t_incomplete_array &&
in->in_brace_level->bl_enclosing == NULL) {
- /* prevent "empty array declaration: %s" */
+ /* prevent "empty array declaration for '%s' [190]" */
size_t dim = in->in_max_subscript;
if (dim == 0 && in->in_err)
dim = 1;
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.458 src/usr.bin/xlint/lint1/tree.c:1.459
--- src/usr.bin/xlint/lint1/tree.c:1.458 Tue Jun 21 22:21:49 2022
+++ src/usr.bin/xlint/lint1/tree.c Wed Jun 22 19:23:18 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.458 2022/06/21 22:21:49 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.459 2022/06/22 19:23:18 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.458 2022/06/21 22:21:49 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.459 2022/06/22 19:23:18 rillig Exp $");
#endif
#include <float.h>
@@ -758,13 +758,13 @@ build_binary(tnode_t *ln, op_t op, bool
*/
if (mp->m_warn_if_left_unsigned_in_c90 &&
ln->tn_op == CON && ln->tn_val->v_unsigned_since_c90) {
- /* ANSI C treats constant as unsigned, op %s */
+ /* ANSI C treats constant as unsigned, op '%s' */
warning(218, mp->m_name);
ln->tn_val->v_unsigned_since_c90 = false;
}
if (mp->m_warn_if_right_unsigned_in_c90 &&
rn->tn_op == CON && rn->tn_val->v_unsigned_since_c90) {
- /* ANSI C treats constant as unsigned, op %s */
+ /* ANSI C treats constant as unsigned, op '%s' */
warning(218, mp->m_name);
rn->tn_val->v_unsigned_since_c90 = false;
}
@@ -1068,7 +1068,7 @@ typeok_address(const mod_t *mp,
return false;
}
if (tn->tn_op == NAME && tn->tn_sym->s_register) {
- /* cannot take address of register %s */
+ /* cannot take address of register '%s' */
error(113, tn->tn_sym->s_name);
return false;
}
@@ -1735,7 +1735,7 @@ check_assign_void_pointer_compat(op_t op
switch (op) {
case INIT:
case RETURN:
- /* incompatible pointer types (%s != %s) */
+ /* incompatible pointer types to '%s' and '%s' */
warning(182, type_name(lstp), type_name(rstp));
break;
case FARG:
@@ -1744,7 +1744,7 @@ check_assign_void_pointer_compat(op_t op
type_name(rtp), type_name(ltp), arg);
break;
default:
- /* operands have incompatible pointer type... */
+ /* operands of '%s' have incompatible pointer ... */
warning(128, op_name(op),
type_name(lstp), type_name(rstp));
break;
@@ -1773,11 +1773,11 @@ check_assign_pointer_integer(op_t op, in
switch (op) {
case INIT:
case RETURN:
- /* illegal combination of %s (%s) and %s (%s) */
+ /* illegal combination of %s '%s' and %s '%s' */
warning(183, lx, type_name(ltp), rx, type_name(rtp));
break;
case FARG:
- /* illegal combination of %s (%s) and %s (%s), arg #%d */
+ /* illegal combination of %s '%s' and %s '%s', arg #%d */
warning(154,
lx, type_name(ltp), rx, type_name(rtp), arg);
break;
@@ -1824,7 +1824,7 @@ warn_assign(op_t op, int arg,
error(185, type_name(ltp), type_name(rtp));
break;
case RETURN:
- /* return value type mismatch (%s) and (%s) */
+ /* function has return type '%s' but returns '%s' */
error(211, type_name(ltp), type_name(rtp));
break;
case FARG:
@@ -1902,7 +1902,7 @@ check_bad_enum_operation(op_t op, const
return;
}
- /* dubious operation on enum, op %s */
+ /* dubious operation on enum, op '%s' */
warning(241, op_name(op));
}
@@ -1924,12 +1924,13 @@ check_enum_type_mismatch(op_t op, int ar
type_name(ln->tn_type), type_name(rn->tn_type));
break;
case FARG:
- /* enum type mismatch, arg #%d (%s != %s) */
- warning(156, arg,
- type_name(ln->tn_type), type_name(rn->tn_type));
+ /* function expects '%s', passing '%s' for arg #%d */
+ warning(156,
+ type_name(ln->tn_type), type_name(rn->tn_type),
+ arg);
break;
case RETURN:
- /* return value type mismatch (%s) and (%s) */
+ /* function has return type '%s' but returns '%s' */
warning(211,
type_name(ln->tn_type), type_name(rn->tn_type));
break;
@@ -1941,7 +1942,7 @@ check_enum_type_mismatch(op_t op, int ar
}
} else if (Pflag && mp->m_comparison && op != EQ && op != NE) {
if (eflag)
- /* dubious comparison of enums, op %s */
+ /* dubious comparison of enums, op '%s' */
warning(243, mp->m_name);
}
}
@@ -1978,7 +1979,7 @@ check_enum_int_mismatch(op_t op, int arg
warning(279, type_name(ln->tn_type), type_name(rn->tn_type));
break;
default:
- /* combination of '%s' and '%s', op %s */
+ /* combination of '%s' and '%s', op '%s' */
warning(242, type_name(ln->tn_type), type_name(rn->tn_type),
op_name(op));
break;
@@ -2444,7 +2445,7 @@ check_integer_conversion(op_t op, int ar
if (Pflag && portable_size_in_bits(nt) > portable_size_in_bits(ot) &&
(tn->tn_op == PLUS || tn->tn_op == MINUS || tn->tn_op == MULT ||
tn->tn_op == SHL)) {
- /* suggest cast from '%s' to '%s' on op %s to ... */
+ /* suggest cast from '%s' to '%s' on op '%s' to ... */
warning(324, type_name(gettyp(ot)), type_name(tp),
op_name(tn->tn_op));
}
@@ -2661,7 +2662,7 @@ convert_constant_check_range_bitor(size_
uint64_t xmask, op_t op)
{
if (nsz < osz && (v->v_quad & xmask) != 0) {
- /* constant truncated by conversion, op %s */
+ /* constant truncated by conversion, op '%s' */
warning(306, op_name(op));
}
}
@@ -2686,7 +2687,7 @@ convert_constant_check_range_bitand(size
} else if (nsz < osz &&
(v->v_quad & xmask) != xmask &&
(v->v_quad & xmask) != 0) {
- /* constant truncated by conversion, op %s */
+ /* constant truncated by conversion, op '%s' */
warning(306, op_name(op));
}
}
@@ -3087,7 +3088,7 @@ build_real_imag(op_t op, bool sys, tnode
cn = build_integer_constant(FLOAT, (int64_t)1);
break;
default:
- /* __%s__ is illegal for type %s */
+ /* '__%s__' is illegal for type '%s' */
error(276, op == REAL ? "real" : "imag",
type_name(ln->tn_type));
return NULL;
@@ -3655,7 +3656,7 @@ fold_float(tnode_t *tn)
(v->v_ldbl > FLT_MAX || v->v_ldbl < -FLT_MAX)) ||
(t == DOUBLE &&
(v->v_ldbl > DBL_MAX || v->v_ldbl < -DBL_MAX))) {
- /* floating point overflow detected, op %s */
+ /* floating point overflow on operator '%s' */
warning(142, op_name(tn->tn_op));
v->v_ldbl = floating_error_value(t, v->v_ldbl);
fpe = 0;
@@ -3935,7 +3936,7 @@ build_function_call(tnode_t *func, bool
if (func->tn_type->t_tspec != PTR ||
func->tn_type->t_subt->t_tspec != FUNC) {
- /* illegal function (type %s) */
+ /* cannot call '%s', must be a function */
error(149, type_name(func->tn_type));
return NULL;
}
@@ -3971,8 +3972,8 @@ check_function_arguments(type_t *ftp, tn
asym = ftp->t_args;
if (ftp->t_proto && npar != narg && !(ftp->t_vararg && npar < narg)) {
- /* argument mismatch: %d arg%s passed, %d expected */
- error(150, narg, narg > 1 ? "s" : "", npar);
+ /* argument mismatch: %d %s passed, %d expected */
+ error(150, narg, narg > 1 ? "arguments" : "argument", npar);
asym = NULL;
}
@@ -4268,7 +4269,7 @@ check_expr_side_effect(const tnode_t *ln
}
if (sc != EXTERN && sc != STATIC &&
!ln->tn_sym->s_set && !szof && di == NULL) {
- /* %s may be used before set */
+ /* '%s' may be used before set */
warning(158, ln->tn_sym->s_name);
mark_as_set(ln->tn_sym);
}
@@ -4528,24 +4529,24 @@ check_integer_comparison(op_t op, tnode_
if (is_uinteger(lt) && !is_uinteger(rt) &&
rn->tn_op == CON && rn->tn_val->v_quad <= 0) {
if (rn->tn_val->v_quad < 0) {
- /* comparison of %s with %s, op %s */
- warning(162, type_name(ln->tn_type),
- "negative constant", op_name(op));
+ /* operator '%s' compares '%s' with '%s' */
+ warning(162, op_name(op),
+ type_name(ln->tn_type), "negative constant");
} else if (op == LT || op == GE) {
- /* comparison of %s with %s, op %s */
- warning(162, type_name(ln->tn_type), "0", op_name(op));
+ /* operator '%s' compares '%s' with '%s' */
+ warning(162, op_name(op), type_name(ln->tn_type), "0");
}
return;
}
if (is_uinteger(rt) && !is_uinteger(lt) &&
ln->tn_op == CON && ln->tn_val->v_quad <= 0) {
if (ln->tn_val->v_quad < 0) {
- /* comparison of %s with %s, op %s */
- warning(162, "negative constant",
- type_name(rn->tn_type), op_name(op));
+ /* operator '%s' compares '%s' with '%s' */
+ warning(162, op_name(op),
+ "negative constant", type_name(rn->tn_type));
} else if (op == GT || op == LE) {
- /* comparison of %s with %s, op %s */
- warning(162, "0", type_name(rn->tn_type), op_name(op));
+ /* operator '%s' compares '%s' with '%s' */
+ warning(162, op_name(op), "0", type_name(rn->tn_type));
}
return;
}