Module Name: src
Committed By: rillig
Date: Fri Jun 17 18:54:53 UTC 2022
Modified Files:
src/tests/usr.bin/xlint: check-expect.lua
src/tests/usr.bin/xlint/lint1: c11_generic_expression.c d_c99_init.c
d_init_array_using_string.c decl.c decl_direct_abstract.c
decl_enum_c90.c decl_struct_member.c expr_binary.c
expr_binary_trad.c expr_precedence.c feat_stacktrace.c
gcc_attribute.c gcc_attribute_aligned.c gcc_attribute_enum.c
gcc_init_compound_literal.c gcc_stmt_asm.c
gcc_typeof_after_statement.c init_c90.c lex_char.c lex_integer.c
lex_integer_binary.c lex_integer_ilp32.c lex_string.c
lex_wide_char.c lex_wide_string.c msg_005.c msg_031.c msg_034.c
msg_041.c msg_048.c msg_066.c msg_069.c msg_077.c msg_080.c
msg_103.c msg_104.c msg_118.c msg_155.c msg_184.c msg_189.c
msg_193.c msg_211.c msg_232.c msg_249.c msg_250.c msg_251.c
msg_253.c msg_254.c msg_257.c msg_259.c msg_259_c90.c
msg_259_ilp32.c msg_265.c msg_283.c msg_289.c msg_312.c msg_333.c
msg_341.c msg_342.c msg_342.exp msg_343.c msg_344.c msg_345.c
op_colon.c parse_stmt_error.c parse_stmt_iter_error.c
parse_type_name.c stmt_for.c stmt_goto.c stmt_if.c
src/usr.bin/xlint/lint1: README.md
Log Message:
tests/lint: make 'expect+-' comments stricter
Previously, the expectations from these comments were already satisfied
if the expectation occurred somewhere in the actual message from lint.
This meant that the prefix 'error:' or 'warning:' could be omitted from
the 'expect' comment. These omissions were hard to see in a manual
review. Now any omissions must be visually marked with '...'.
The test msg_342 now reports its messages properly as being in the file
msg_342.c, rather than msg_341.c. This had been a copy-and-paste
mistake.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.11 -r1.12 \
src/tests/usr.bin/xlint/lint1/c11_generic_expression.c \
src/tests/usr.bin/xlint/lint1/msg_249.c
cvs rdiff -u -r1.40 -r1.41 src/tests/usr.bin/xlint/lint1/d_c99_init.c
cvs rdiff -u -r1.10 -r1.11 \
src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \
src/tests/usr.bin/xlint/lint1/gcc_attribute.c \
src/tests/usr.bin/xlint/lint1/msg_155.c
cvs rdiff -u -r1.16 -r1.17 src/tests/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c \
src/tests/usr.bin/xlint/lint1/msg_343.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/decl_enum_c90.c \
src/tests/usr.bin/xlint/lint1/expr_binary_trad.c \
src/tests/usr.bin/xlint/lint1/lex_integer_binary.c \
src/tests/usr.bin/xlint/lint1/msg_341.c \
src/tests/usr.bin/xlint/lint1/msg_344.c \
src/tests/usr.bin/xlint/lint1/parse_stmt_error.c \
src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c \
src/tests/usr.bin/xlint/lint1/stmt_goto.c \
src/tests/usr.bin/xlint/lint1/stmt_if.c
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/xlint/lint1/decl_struct_member.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/expr_binary.c \
src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c \
src/tests/usr.bin/xlint/lint1/lex_char.c \
src/tests/usr.bin/xlint/lint1/msg_034.c \
src/tests/usr.bin/xlint/lint1/msg_066.c \
src/tests/usr.bin/xlint/lint1/msg_077.c \
src/tests/usr.bin/xlint/lint1/msg_118.c \
src/tests/usr.bin/xlint/lint1/msg_189.c \
src/tests/usr.bin/xlint/lint1/msg_232.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/expr_precedence.c \
src/tests/usr.bin/xlint/lint1/parse_type_name.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/feat_stacktrace.c \
src/tests/usr.bin/xlint/lint1/gcc_attribute_aligned.c \
src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c \
src/tests/usr.bin/xlint/lint1/lex_wide_char.c \
src/tests/usr.bin/xlint/lint1/lex_wide_string.c \
src/tests/usr.bin/xlint/lint1/msg_345.c \
src/tests/usr.bin/xlint/lint1/op_colon.c \
src/tests/usr.bin/xlint/lint1/stmt_for.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/gcc_attribute_enum.c \
src/tests/usr.bin/xlint/lint1/lex_string.c \
src/tests/usr.bin/xlint/lint1/msg_005.c \
src/tests/usr.bin/xlint/lint1/msg_041.c \
src/tests/usr.bin/xlint/lint1/msg_048.c \
src/tests/usr.bin/xlint/lint1/msg_080.c \
src/tests/usr.bin/xlint/lint1/msg_184.c \
src/tests/usr.bin/xlint/lint1/msg_250.c \
src/tests/usr.bin/xlint/lint1/msg_265.c \
src/tests/usr.bin/xlint/lint1/msg_333.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/gcc_stmt_asm.c \
src/tests/usr.bin/xlint/lint1/init_c90.c \
src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c \
src/tests/usr.bin/xlint/lint1/msg_069.c \
src/tests/usr.bin/xlint/lint1/msg_103.c \
src/tests/usr.bin/xlint/lint1/msg_104.c \
src/tests/usr.bin/xlint/lint1/msg_211.c \
src/tests/usr.bin/xlint/lint1/msg_251.c \
src/tests/usr.bin/xlint/lint1/msg_253.c \
src/tests/usr.bin/xlint/lint1/msg_254.c \
src/tests/usr.bin/xlint/lint1/msg_257.c \
src/tests/usr.bin/xlint/lint1/msg_259_c90.c \
src/tests/usr.bin/xlint/lint1/msg_283.c \
src/tests/usr.bin/xlint/lint1/msg_289.c \
src/tests/usr.bin/xlint/lint1/msg_312.c \
src/tests/usr.bin/xlint/lint1/msg_342.c \
src/tests/usr.bin/xlint/lint1/msg_342.exp
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/lex_integer.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_031.c \
src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c
cvs rdiff -u -r1.18 -r1.19 src/tests/usr.bin/xlint/lint1/msg_193.c
cvs rdiff -u -r1.20 -r1.21 src/tests/usr.bin/xlint/lint1/msg_259.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/lint1/README.md
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/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.20 src/tests/usr.bin/xlint/check-expect.lua:1.21
--- src/tests/usr.bin/xlint/check-expect.lua:1.20 Fri Jun 17 16:10:10 2022
+++ src/tests/usr.bin/xlint/check-expect.lua Fri Jun 17 18:54:53 2022
@@ -1,5 +1,5 @@
#! /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.20 2022/06/17 16:10:10 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.21 2022/06/17 18:54:53 rillig Exp $
--[[
@@ -12,6 +12,17 @@ To regenerate the .exp files, see lint1/
]]
+local function test(func)
+ func()
+end
+
+local function assert_equals(got, expected)
+ if got ~= expected then
+ assert(false, string.format("got %q, expected %q", got, expected))
+ end
+end
+
+
local had_errors = false
---@param fmt string
function print_error(fmt, ...)
@@ -34,6 +45,7 @@ local function load_lines(fname)
return lines
end
+
-- Load the 'expect:' comments from a C source file.
--
-- example return values:
@@ -114,6 +126,52 @@ local function load_exp(exp_fname)
end
+---@param comment string
+---@param pattern string
+---@return boolean
+local function matches(comment, pattern)
+ if comment == "" then return false end
+
+ local any_prefix = pattern:sub(1, 3) == "..."
+ if any_prefix then pattern = pattern:sub(4) end
+ local any_suffix = pattern:sub(-3) == "..."
+ if any_suffix then pattern = pattern:sub(1, -4) end
+
+ if any_prefix and any_suffix then
+ return comment:find(pattern, 1, true) ~= nil
+ elseif any_prefix then
+ return pattern ~= "" and comment:sub(-#pattern) == pattern
+ elseif any_suffix then
+ return comment:sub(1, #pattern) == pattern
+ else
+ return comment == pattern
+ end
+end
+
+test(function()
+ assert_equals(matches("a", "a"), true)
+ assert_equals(matches("a", "b"), false)
+ assert_equals(matches("a", "aaa"), false)
+
+ assert_equals(matches("abc", "a..."), true)
+ assert_equals(matches("abc", "c..."), false)
+
+ assert_equals(matches("abc", "...c"), true)
+ assert_equals(matches("abc", "...a"), false)
+
+ assert_equals(matches("abc123xyz", "...a..."), true)
+ assert_equals(matches("abc123xyz", "...b..."), true)
+ assert_equals(matches("abc123xyz", "...c..."), true)
+ assert_equals(matches("abc123xyz", "...1..."), true)
+ assert_equals(matches("abc123xyz", "...2..."), true)
+ assert_equals(matches("abc123xyz", "...3..."), true)
+ assert_equals(matches("abc123xyz", "...x..."), true)
+ assert_equals(matches("abc123xyz", "...y..."), true)
+ assert_equals(matches("abc123xyz", "...z..."), true)
+ assert_equals(matches("pattern", "...pattern..."), true)
+end)
+
+
local function check_test(c_fname)
local exp_fname = c_fname:gsub("%.c$", ".exp")
@@ -125,12 +183,12 @@ local function check_test(c_fname)
for _, exp_message in ipairs(exp_messages) do
local c_comments = c_comments_by_location[exp_message.location] or {}
- local expected_comment =
+ local expected_message =
exp_message.message:gsub("/%*", "**"):gsub("%*/", "**")
local found = false
for i, c_comment in ipairs(c_comments) do
- if c_comment ~= "" and expected_comment:find(c_comment, 1, true) then
+ if c_comment ~= "" and matches(expected_message, c_comment) then
c_comments[i] = ""
found = true
break
@@ -139,7 +197,7 @@ local function check_test(c_fname)
if not found then
print_error("error: %s: missing /* expect+1: %s */",
- exp_message.location, expected_comment)
+ exp_message.location, expected_message)
end
end
Index: src/tests/usr.bin/xlint/lint1/c11_generic_expression.c
diff -u src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.11 src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.12
--- src/tests/usr.bin/xlint/lint1/c11_generic_expression.c:1.11 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/c11_generic_expression.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: c11_generic_expression.c,v 1.11 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: c11_generic_expression.c,v 1.12 2022/06/17 18:54:53 rillig Exp $ */
# 3 "c11_generic_expression.c"
/*
@@ -20,14 +20,14 @@
const char *
classify_type_without_default(double var)
{
- /* expect-2: argument 'var' unused */
+ /* expect-2: warning: argument 'var' unused in function 'classify_type_without_default' [231] */
return _Generic(var,
long double: "long double",
long long: "long long",
unsigned: "unsigned"
);
- /* expect-1: expects to return value [214] */
+ /* expect-1: warning: function 'classify_type_without_default' expects to return value [214] */
}
/*
@@ -36,7 +36,7 @@ classify_type_without_default(double var
const char *
classify_type_with_default(double var)
{
- /* expect-2: argument 'var' unused */
+ /* expect-2: warning: argument 'var' unused in function 'classify_type_with_default' [231] */
return _Generic(var,
long double: "long double",
@@ -52,7 +52,7 @@ classify_type_with_default(double var)
const char *
classify_char(char c)
{
- /* expect-2: argument 'c' unused */
+ /* expect-2: warning: argument 'c' unused in function 'classify_char' [231] */
return _Generic(c,
char: "yes",
@@ -74,7 +74,7 @@ comma_expression(char first, double seco
char: "first",
double: 2.0
);
- /* expect+1: without returning value [217] */
+ /* expect+1: warning: function comma_expression falls off bottom without returning value [217] */
}
/*
Index: src/tests/usr.bin/xlint/lint1/msg_249.c
diff -u src/tests/usr.bin/xlint/lint1/msg_249.c:1.11 src/tests/usr.bin/xlint/lint1/msg_249.c:1.12
--- src/tests/usr.bin/xlint/lint1/msg_249.c:1.11 Thu Jun 16 21:24:41 2022
+++ src/tests/usr.bin/xlint/lint1/msg_249.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_249.c,v 1.11 2022/06/16 21:24:41 rillig Exp $ */
+/* $NetBSD: msg_249.c,v 1.12 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_249.c"
// Test for message: syntax error '%s' [249]
@@ -6,7 +6,7 @@
/*
* Cover the grammar rule 'top_level_declaration: error T_SEMI'.
*/
-/* expect+1: syntax error '"' [249] */
+/* expect+1: error: syntax error '"' [249] */
"syntax error in top_level_declaration";
/* XXX: This is necessary to recover the yacc parser. */
@@ -15,7 +15,7 @@ int recover_from_semi;
/*
* Cover the grammar rule 'top_level_declaration: error T_RBRACE'.
*/
-/* expect+1: syntax error '"' [249] */
+/* expect+1: error: syntax error '"' [249] */
"syntax error in top_level_declaration"}
/* XXX: This is necessary to recover the yacc parser. */
Index: src/tests/usr.bin/xlint/lint1/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.40 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.41
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.40 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_c99_init.c,v 1.40 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: d_c99_init.c,v 1.41 2022/06/17 18:54:53 rillig Exp $ */
# 3 "d_c99_init.c"
/*
@@ -222,11 +222,11 @@ struct geometry geometry = {
.pentagons[0].points[4].x = 1,
.points[0][0][0] = { 0, 0 },
.points[2][4][1] = {301, 302 },
- /* expect+1: array subscript cannot be > 2: 3 */
+ /* expect+1: error: array subscript cannot be > 2: 3 [168] */
.points[3][0][0] = {3001, 3002 },
- /* expect+1: array subscript cannot be > 4: 5 */
+ /* expect+1: error: array subscript cannot be > 4: 5 [168] */
.points[0][5][0] = {501, 502 },
- /* expect+1: array subscript cannot be > 1: 2 */
+ /* expect+1: error: array subscript cannot be > 1: 2 [168] */
.points[0][0][2] = {21, 22 },
};
@@ -235,13 +235,13 @@ struct ends_with_unnamed_bit_field {
int:0;
} ends_with_unnamed_bit_field = {
12345,
- /* expect+1: too many struct/union initializers */
+ /* expect+1: error: too many struct/union initializers [172] */
23456,
};
char prefixed_message[] = {
'E', ':', ' ',
- /* expect+1: illegal combination of integer (char) and pointer */
+ /* expect+1: warning: illegal combination of integer (char) and pointer (pointer to char) [183] */
"message\n",
};
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.10 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.10 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: d_init_array_using_string.c,v 1.10 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: d_init_array_using_string.c,v 1.11 2022/06/17 18:54:53 rillig Exp $ */
# 3 "d_init_array_using_string.c"
/*
@@ -72,9 +72,9 @@ test_array_initialization_in_struct(void
};
struct cs_ws too_many_characters = {
- /* expect+1: warning: string literal too long (11) for target array (10) */
+ /* expect+1: warning: string literal too long (11) for target array (10) [187] */
"0123456789X",
- /* expect+1: warning: string literal too long (11) for target array (10) */
+ /* expect+1: warning: string literal too long (11) for target array (10) [187] */
L"0123456789X",
};
Index: src/tests/usr.bin/xlint/lint1/gcc_attribute.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_attribute.c:1.10 src/tests/usr.bin/xlint/lint1/gcc_attribute.c:1.11
--- src/tests/usr.bin/xlint/lint1/gcc_attribute.c:1.10 Thu Jul 15 21:00:05 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_attribute.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_attribute.c,v 1.10 2021/07/15 21:00:05 rillig Exp $ */
+/* $NetBSD: gcc_attribute.c,v 1.11 2022/06/17 18:54:53 rillig Exp $ */
# 3 "gcc_attribute.c"
/*
@@ -29,7 +29,7 @@ function_nonnull_list(void *, const void
void __attribute__((nonnull(1, 2)))
function_nonnull_list(void *, const void *, int);
-/* expect+1: syntax error 'unknown_attribute' */
+/* expect+1: error: syntax error 'unknown_attribute' [249] */
void __attribute__((unknown_attribute))
function_with_unknown_attribute(void);
@@ -125,5 +125,5 @@ __attribute__((deprecated("d5")))
*/
int const_function(int) __attribute__((const));
/* cover 'gcc_attribute_spec: T_QUAL' */
-/* expect+1: syntax error 'volatile' [249] */
+/* expect+1: error: syntax error 'volatile' [249] */
int volatile_function(int) __attribute__((volatile));
Index: src/tests/usr.bin/xlint/lint1/msg_155.c
diff -u src/tests/usr.bin/xlint/lint1/msg_155.c:1.10 src/tests/usr.bin/xlint/lint1/msg_155.c:1.11
--- src/tests/usr.bin/xlint/lint1/msg_155.c:1.10 Fri Apr 1 22:28:21 2022
+++ src/tests/usr.bin/xlint/lint1/msg_155.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_155.c,v 1.10 2022/04/01 22:28:21 rillig Exp $ */
+/* $NetBSD: msg_155.c,v 1.11 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_155.c"
// Test for message: passing '%s' to incompatible '%s', arg #%d [155]
@@ -21,30 +21,30 @@ struct incompatible {
void
provoke_error_messages(struct incompatible arg)
{
- /* expect+1: 'int' */
+ /* expect+1: ... 'int', ... */
c99_6_7_6_example_a(arg);
- /* expect+1: 'pointer to int' */
+ /* expect+1: ... 'pointer to int', ... */
c99_6_7_6_example_b(arg);
/* C99 says 'array[3] of pointer to int', which is close enough. */
- /* expect+1: 'pointer to pointer to int' */
+ /* expect+1: ... 'pointer to pointer to int', ... */
c99_6_7_6_example_c(arg);
- /* expect+1: 'pointer to array[3] of int' */
+ /* expect+1: ... 'pointer to array[3] of int', ... */
c99_6_7_6_example_d(arg);
- /* expect+1: 'pointer to array[unknown_size] of int' */
+ /* expect+1: ... 'pointer to array[unknown_size] of int', ... */
c99_6_7_6_example_e(arg);
/* Wrong type before decl.c 1.256 from 2022-04-01. */
- /* expect+1: 'pointer to function() returning pointer to int' */
+ /* expect+1: ... 'pointer to function() returning pointer to int', ... */
c99_6_7_6_example_f(arg);
- /* expect+1: 'pointer to function(void) returning int' */
+ /* expect+1: ... 'pointer to function(void) returning int', ... */
c99_6_7_6_example_g(arg);
- /* expect+1: 'pointer to const pointer to function(unsigned int, ...) returning int' */
+ /* expect+1: ... 'pointer to const pointer to function(unsigned int, ...) returning int', ... */
c99_6_7_6_example_h(arg);
}
@@ -65,15 +65,15 @@ type_name_of_enum(void)
MONDAY
} day = MONDAY;
- /* expect+1: passing 'enum Day' */
+ /* expect+1: ... passing 'enum Day' ... */
sink(day);
- /* expect+1: passing 'enum Day' */
+ /* expect+1: ... passing 'enum Day' ... */
sink(day + 0);
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
sink(0 + day);
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
sink(0);
}
Index: src/tests/usr.bin/xlint/lint1/decl.c
diff -u src/tests/usr.bin/xlint/lint1/decl.c:1.16 src/tests/usr.bin/xlint/lint1/decl.c:1.17
--- src/tests/usr.bin/xlint/lint1/decl.c:1.16 Sat Jun 11 11:52:13 2022
+++ src/tests/usr.bin/xlint/lint1/decl.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.16 2022/06/11 11:52:13 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.17 2022/06/17 18:54:53 rillig Exp $ */
# 3 "decl.c"
/*
@@ -39,7 +39,7 @@ qualifier_specifier(void)
void
declarator_with_prefix_qualifier(void)
{
- /* expect+1: syntax error 'const' [249] */
+ /* expect+1: error: syntax error 'const' [249] */
char a = 1, const b = 2;
a = 1;
@@ -50,7 +50,7 @@ declarator_with_prefix_qualifier(void)
void
declarator_with_postfix_qualifier(void)
{
- /* expect+1: syntax error 'const' [249] */
+ /* expect+1: error: syntax error 'const' [249] */
char a = 1, b const = 2;
a = 1;
@@ -64,11 +64,11 @@ declarators(void)
{
char *pc = 0, c = 0, **ppc = 0;
- /* expect+1: warning: converting 'pointer to char' to incompatible 'pointer to double' */
+ /* 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) */
+ /* expect+1: warning: illegal combination of pointer (pointer to double) and integer (char), arg #1 [154] */
sink(c);
- /* expect+1: converting 'pointer to pointer to char' to incompatible 'pointer to double' */
+ /* expect+1: warning: converting 'pointer to pointer to char' to incompatible 'pointer to double' for argument 1 [153] */
sink(ppc);
}
@@ -76,7 +76,7 @@ _Bool
enum_error_handling(void)
{
enum {
- /* expect+1: syntax error '"' [249] */
+ /* expect+1: error: syntax error '"' [249] */
"error 1"
: /* still the same error */
, /* back on track */
@@ -160,11 +160,11 @@ unsigned long sizes =
sizeof(const typeof(unnamed_struct));
/* expect+2: error: old style declaration; add 'int' [1] */
-/* expect+1: syntax error 'int' [249] */
+/* expect+1: error: syntax error 'int' [249] */
thread int thread_int;
__thread int thread_int;
/* expect+2: error: old style declaration; add 'int' [1] */
-/* expect+1: syntax error 'int' [249] */
+/* expect+1: error: syntax error 'int' [249] */
__thread__ int thread_int;
/* expect+4: error: old style declaration; add 'int' [1] */
Index: src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c
diff -u src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.6 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.7
--- src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.6 Fri Apr 1 23:16:32 2022
+++ src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl_direct_abstract.c,v 1.6 2022/04/01 23:16:32 rillig Exp $ */
+/* $NetBSD: decl_direct_abstract.c,v 1.7 2022/06/17 18:54:53 rillig Exp $ */
# 3 "decl_direct_abstract.c"
/*
@@ -19,7 +19,7 @@ char func0001(short (*)(long));
/* GCC says 'char (*)(short int (*)(long int))' */
/* Clang says 'char (short (*)(long))' */
/* cdecl says 'function (pointer to function (long) returning short) returning char' */
-/* expect+1: 'pointer to function(pointer to function(long) returning short) returning char' */
+/* expect+1: error: cannot initialize 'double' from 'pointer to function(pointer to function(long) returning short) returning char' [185] */
double type_of_func0001 = func0001;
char func0002(short *(long));
@@ -28,7 +28,7 @@ char func0002(short *(long));
/* Clang says 'char (short *(*)(long))' */
/* cdecl says 'syntax error' */
/* FIXME: lint is wrong, it discards the 'short *' */
-/* expect+1: 'pointer to function(long) returning char' */
+/* expect+1: error: cannot initialize 'double' from 'pointer to function(long) returning char' [185] */
double type_of_func0002 = func0002;
void c99_6_7_6_example_a(int);
@@ -44,22 +44,22 @@ struct incompatible {
int member;
} x;
-/* expect+1: 'pointer to function(int) returning void' */
+/* expect+1: ... 'pointer to function(int) returning void' ... */
double type_of_c99_6_7_6_example_a = c99_6_7_6_example_a;
-/* expect+1: 'pointer to function(pointer to int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to int) returning void' ... */
double type_of_c99_6_7_6_example_b = c99_6_7_6_example_b;
-/* expect+1: 'pointer to function(pointer to pointer to int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to pointer to int) returning void' ... */
double type_of_c99_6_7_6_example_c = c99_6_7_6_example_c;
-/* expect+1: 'pointer to function(pointer to array[3] of int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to array[3] of int) returning void' ... */
double type_of_c99_6_7_6_example_d = c99_6_7_6_example_d;
-/* expect+1: 'pointer to function(pointer to array[unknown_size] of int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to array[unknown_size] of int) returning void' ... */
double type_of_c99_6_7_6_example_e = c99_6_7_6_example_e;
/* Wrong type before decl.c 1.256 from 2022-04-01. */
-/* expect+1: 'pointer to function(pointer to function() returning pointer to int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to function() returning pointer to int) returning void' ... */
double type_of_c99_6_7_6_example_f = c99_6_7_6_example_f;
-/* expect+1: 'pointer to function(pointer to function(void) returning int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to function(void) returning int) returning void' ... */
double type_of_c99_6_7_6_example_g = c99_6_7_6_example_g;
-/* expect+1: 'pointer to function(pointer to const pointer to function(unsigned int, ...) returning int) returning void' */
+/* expect+1: ... 'pointer to function(pointer to const pointer to function(unsigned int, ...) returning int) returning void' ... */
double type_of_c99_6_7_6_example_h = c99_6_7_6_example_h;
void int_array(int[]);
Index: src/tests/usr.bin/xlint/lint1/msg_343.c
diff -u src/tests/usr.bin/xlint/lint1/msg_343.c:1.6 src/tests/usr.bin/xlint/lint1/msg_343.c:1.7
--- src/tests/usr.bin/xlint/lint1/msg_343.c:1.6 Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_343.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_343.c,v 1.6 2022/06/17 06:59:16 rillig Exp $ */
+/* $NetBSD: msg_343.c,v 1.7 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_343.c"
/* Test for message: static array size is a C11 extension [343] */
@@ -9,7 +9,7 @@ void takes_int_pointer(int []);
void takes_int_pointer_with_ignored_size(int [3]);
/* expect+1: error: static array size is a C11 extension [343] */
void takes_int_array(int[static 3]);
-/* expect+1: syntax error '3' */
+/* expect+1: error: syntax error '3' [249] */
void takes_volatile_int_array(int[volatile 3]);
int
@@ -32,11 +32,11 @@ returns_int_array(int a[static 3])
}
int
-/* expect+1: syntax error '3' */
+/* expect+1: error: syntax error '3' [249] */
returns_volatile_int_array(int a[volatile 3])
{
- /* expect+2: cannot dereference non-pointer type */
- /* expect+1: expects to return value */
+ /* expect+2: error: cannot dereference non-pointer type [96] */
+ /* expect+1: ... expects to return value [214] */
return a[0];
}
Index: src/tests/usr.bin/xlint/lint1/decl_enum_c90.c
diff -u src/tests/usr.bin/xlint/lint1/decl_enum_c90.c:1.1 src/tests/usr.bin/xlint/lint1/decl_enum_c90.c:1.2
--- src/tests/usr.bin/xlint/lint1/decl_enum_c90.c:1.1 Thu Jul 15 21:00:05 2021
+++ src/tests/usr.bin/xlint/lint1/decl_enum_c90.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl_enum_c90.c,v 1.1 2021/07/15 21:00:05 rillig Exp $ */
+/* $NetBSD: decl_enum_c90.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "decl_enum_c90.c"
/*
@@ -10,4 +10,4 @@
enum {
A,
};
-/* expect-1: trailing ',' prohibited in enum declaration [54] */
+/* expect-1: error: trailing ',' prohibited in enum declaration [54] */
Index: src/tests/usr.bin/xlint/lint1/expr_binary_trad.c
diff -u src/tests/usr.bin/xlint/lint1/expr_binary_trad.c:1.1 src/tests/usr.bin/xlint/lint1/expr_binary_trad.c:1.2
--- src/tests/usr.bin/xlint/lint1/expr_binary_trad.c:1.1 Sun Aug 1 16:29:28 2021
+++ src/tests/usr.bin/xlint/lint1/expr_binary_trad.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: expr_binary_trad.c,v 1.1 2021/08/01 16:29:28 rillig Exp $ */
+/* $NetBSD: expr_binary_trad.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "expr_binary_trad.c"
/*
@@ -21,47 +21,47 @@ void
cover_balance()
{
- /* expect+1: 'pointer to char' */
+ /* expect+1: ... 'pointer to char' ... */
sink = (char *)0 + 0;
- /* expect+1: 'pointer to char' */
+ /* expect+1: ... 'pointer to char' ... */
sink = 0 + (char *)0;
- /* expect+1: 'int' */
+ /* expect+1: ... 'int' ... */
sink = 1 + 1;
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink = 0.0 + 0;
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink = 0 + 0.0;
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink = 0.0 + (float)0.0;
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink = (float)0.0 + 0.0;
/*
* In traditional C, 'float' gets promoted to 'double' before
* applying the usual arithmetic conversions; see 'promote'.
*/
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink = (float)0.0 + 0;
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink = 0 + (float)0.0;
- /* expect+1: 'unsigned long' */
+ /* expect+1: ... 'unsigned long' ... */
sink = (unsigned long)0 + 0;
- /* expect+1: 'unsigned long' */
+ /* expect+1: ... 'unsigned long' ... */
sink = 0 + (unsigned long)0;
- /* expect+1: 'unsigned long' */
+ /* expect+1: ... 'unsigned long' ... */
sink = (unsigned long)0 + (long)0;
- /* expect+1: 'unsigned long' */
+ /* expect+1: ... 'unsigned long' ... */
sink = (long)0 + (unsigned long)0;
/*
* In traditional C, if one of the operands is unsigned, the result
* is unsigned as well.
*/
- /* expect+1: 'unsigned long' */
+ /* expect+1: ... 'unsigned long' ... */
sink = (unsigned)0 + (long)0;
}
Index: src/tests/usr.bin/xlint/lint1/lex_integer_binary.c
diff -u src/tests/usr.bin/xlint/lint1/lex_integer_binary.c:1.1 src/tests/usr.bin/xlint/lint1/lex_integer_binary.c:1.2
--- src/tests/usr.bin/xlint/lint1/lex_integer_binary.c:1.1 Tue Jul 13 19:38:10 2021
+++ src/tests/usr.bin/xlint/lint1/lex_integer_binary.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_integer_binary.c,v 1.1 2021/07/13 19:38:10 rillig Exp $ */
+/* $NetBSD: lex_integer_binary.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_integer_binary.c"
/*
@@ -25,6 +25,6 @@ binary_literal(void)
* Even though it would be useful for binary literals, GCC does not
* support underscores to separate the digit groups.
*/
- /* expect+1: syntax error '_0000_0101_1010' [249] */
+ /* expect+1: error: syntax error '_0000_0101_1010' [249] */
sink(0b1111_0000_0101_1010);
}
Index: src/tests/usr.bin/xlint/lint1/msg_341.c
diff -u src/tests/usr.bin/xlint/lint1/msg_341.c:1.1 src/tests/usr.bin/xlint/lint1/msg_341.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_341.c:1.1 Mon Apr 5 02:05:47 2021
+++ src/tests/usr.bin/xlint/lint1/msg_341.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_341.c,v 1.1 2021/04/05 02:05:47 rillig Exp $ */
+/* $NetBSD: msg_341.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_341.c"
// Test for message: argument to '%s' must be 'unsigned char' or EOF, not '%s' [341]
@@ -20,7 +20,7 @@ void
function_call_char(char c)
{
- /* expect+1: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' */
+ /* expect+1: warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341] */
(isspace)(c);
/* This is the only allowed form. */
@@ -29,10 +29,10 @@ function_call_char(char c)
/* The cast to 'int' is redundant, it doesn't hurt though. */
isspace((int)(unsigned char)c);
- /* expect+1: argument to 'isspace' must be cast to 'unsigned char', not to 'int' */
+ /* expect+1: warning: argument to 'isspace' must be cast to 'unsigned char', not to 'int' [342] */
isspace((int)c);
- /* expect+1: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' */
+ /* expect+1: warning: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' [342] */
isspace((unsigned int)c);
}
@@ -63,15 +63,15 @@ void
macro_invocation_NetBSD(char c)
{
- /* expect+1: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' */
+ /* expect+1: warning: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' [341] */
sink(((int)((_ctype_tab_ + 1)[(c)] & 0x0040)));
/* This is the only allowed form. */
sink(((int)((_ctype_tab_ + 1)[((unsigned char)c)] & 0x0040)));
- /* expect+1: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' */
+ /* expect+1: warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' [342] */
sink(((int)((_ctype_tab_ + 1)[((int)c)] & 0x0040)));
- /* expect+1: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' */
+ /* expect+1: warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342] */
sink(((int)((_ctype_tab_ + 1)[((unsigned int)c)] & 0x0040)));
}
Index: src/tests/usr.bin/xlint/lint1/msg_344.c
diff -u src/tests/usr.bin/xlint/lint1/msg_344.c:1.1 src/tests/usr.bin/xlint/lint1/msg_344.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_344.c:1.1 Sun May 16 11:11:37 2021
+++ src/tests/usr.bin/xlint/lint1/msg_344.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_344.c,v 1.1 2021/05/16 11:11:37 rillig Exp $ */
+/* $NetBSD: msg_344.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_344.c"
// Test for message: bit-field of type plain 'int' has implementation-defined signedness [344]
@@ -16,7 +16,7 @@
* allows typedef-types for bit-fields.
*/
struct example {
- /* expect+1: 344 */
+ /* expect+1: warning: bit-field of type plain 'int' has implementation-defined signedness [344] */
int plain_int: 1;
signed int signed_int: 1;
Index: src/tests/usr.bin/xlint/lint1/parse_stmt_error.c
diff -u src/tests/usr.bin/xlint/lint1/parse_stmt_error.c:1.1 src/tests/usr.bin/xlint/lint1/parse_stmt_error.c:1.2
--- src/tests/usr.bin/xlint/lint1/parse_stmt_error.c:1.1 Sun Jul 25 09:29:20 2021
+++ src/tests/usr.bin/xlint/lint1/parse_stmt_error.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: parse_stmt_error.c,v 1.1 2021/07/25 09:29:20 rillig Exp $ */
+/* $NetBSD: parse_stmt_error.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "parse_stmt_error.c"
/*
@@ -13,7 +13,7 @@ cover_selection_statement_else(_Bool con
if (cond)
do_nothing();
else
- /* expect+1: syntax error ']' [249] */
+ /* expect+1: error: syntax error ']' [249] */
];
}
@@ -21,6 +21,6 @@ void
cover_selection_statement_switch(int x)
{
switch (x)
- /* expect+1: syntax error ']' [249] */
+ /* expect+1: error: syntax error ']' [249] */
];
}
Index: src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c
diff -u src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c:1.1 src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c:1.2
--- src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c:1.1 Sun Jul 25 09:29:20 2021
+++ src/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: parse_stmt_iter_error.c,v 1.1 2021/07/25 09:29:20 rillig Exp $ */
+/* $NetBSD: parse_stmt_iter_error.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "parse_stmt_iter_error.c"
/*
@@ -11,7 +11,7 @@ void
cover_iteration_statement_while(_Bool cond)
{
while (cond)
- /* expect+1: syntax error ']' [249] */
+ /* expect+1: error: syntax error ']' [249] */
];
}
@@ -19,7 +19,7 @@ void
cover_iteration_statement_do(void)
{
do
- /* expect+1: syntax error ']' [249] */
+ /* expect+1: error: syntax error ']' [249] */
];
}
@@ -27,6 +27,6 @@ void
cover_iteration_statement_for(void)
{
for (int i = 0; i < 10; i++)
- /* expect+1: syntax error ']' [249] */
+ /* expect+1: error: syntax error ']' [249] */
];
}
Index: src/tests/usr.bin/xlint/lint1/stmt_goto.c
diff -u src/tests/usr.bin/xlint/lint1/stmt_goto.c:1.1 src/tests/usr.bin/xlint/lint1/stmt_goto.c:1.2
--- src/tests/usr.bin/xlint/lint1/stmt_goto.c:1.1 Wed Jul 14 20:39:13 2021
+++ src/tests/usr.bin/xlint/lint1/stmt_goto.c Fri Jun 17 18:54:53 2022
@@ -1,11 +1,11 @@
-/* $NetBSD: stmt_goto.c,v 1.1 2021/07/14 20:39:13 rillig Exp $ */
+/* $NetBSD: stmt_goto.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "stmt_goto.c"
/*
* Tests for the 'goto' statement.
*/
-/* expect+1: syntax error 'goto' [249] */
+/* expect+1: error: syntax error 'goto' [249] */
goto invalid_at_top_level;
void
@@ -13,7 +13,7 @@ function(void)
{
goto label;
label:
- /* expect+1: syntax error '"' [249] */
+ /* expect+1: error: syntax error '"' [249] */
goto "string";
/* Reset the error handling of the parser. */
@@ -21,6 +21,6 @@ label:
ok:
/* Numeric labels work in Pascal, but not in C. */
- /* expect+1: syntax error '12345' [249] */
+ /* expect+1: error: syntax error '12345' [249] */
goto 12345;
}
Index: src/tests/usr.bin/xlint/lint1/stmt_if.c
diff -u src/tests/usr.bin/xlint/lint1/stmt_if.c:1.1 src/tests/usr.bin/xlint/lint1/stmt_if.c:1.2
--- src/tests/usr.bin/xlint/lint1/stmt_if.c:1.1 Sun Jul 11 18:58:13 2021
+++ src/tests/usr.bin/xlint/lint1/stmt_if.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: stmt_if.c,v 1.1 2021/07/11 18:58:13 rillig Exp $ */
+/* $NetBSD: stmt_if.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */
# 3 "stmt_if.c"
/*
@@ -22,7 +22,7 @@ dangling_else(int x)
*/
else
println("not positive");
- /* expect+1: syntax error 'else' [249] */
+ /* expect+1: error: syntax error 'else' [249] */
else
println("syntax error");
}
Index: src/tests/usr.bin/xlint/lint1/decl_struct_member.c
diff -u src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.14 src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.15
--- src/tests/usr.bin/xlint/lint1/decl_struct_member.c:1.14 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/decl_struct_member.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: decl_struct_member.c,v 1.14 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: decl_struct_member.c,v 1.15 2022/06/17 18:54:53 rillig Exp $ */
# 3 "decl_struct_member.c"
struct multi_attributes {
@@ -87,4 +87,4 @@ struct {
* assertion "t == NOTSPEC" failed in end_type at decl.c:774
*/
};
-/* expect+1: cannot recover from previous errors */
+/* expect+1: error: cannot recover from previous errors [224] */
Index: src/tests/usr.bin/xlint/lint1/expr_binary.c
diff -u src/tests/usr.bin/xlint/lint1/expr_binary.c:1.5 src/tests/usr.bin/xlint/lint1/expr_binary.c:1.6
--- src/tests/usr.bin/xlint/lint1/expr_binary.c:1.5 Sun Aug 1 14:51:41 2021
+++ src/tests/usr.bin/xlint/lint1/expr_binary.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: expr_binary.c,v 1.5 2021/08/01 14:51:41 rillig Exp $ */
+/* $NetBSD: expr_binary.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "expr_binary.c"
/*
@@ -20,19 +20,19 @@ void sink(struct incompatible);
void
cover_balance(void)
{
- /* expect+1: 'pointer to void' */
+ /* expect+1: ... 'pointer to void' ... */
sink((void *)0 + 0);
- /* expect+1: 'pointer to void' */
+ /* expect+1: ... 'pointer to void' ... */
sink(0 + (void *)0);
- /* expect+1: 'int' */
+ /* expect+1: ... 'int' ... */
sink(1 + 1);
- /* expect+1: 'const int' */
+ /* expect+1: ... 'const int' ... */
sink((const int)1 + (volatile int)1);
- /* expect+1: 'volatile int' */
+ /* expect+1: ... 'volatile int' ... */
sink((volatile int)1 + (const int)1);
long double _Complex cldbl = 0.0;
@@ -41,89 +41,89 @@ cover_balance(void)
/* expect+1: error: invalid type for _Complex [308] */
_Complex invalid = 0.0;
- /* expect+1: 'long double _Complex' */
+ /* expect+1: ... 'long double _Complex' ... */
sink(cldbl + 0);
- /* expect+1: 'long double _Complex' */
+ /* expect+1: ... 'long double _Complex' ... */
sink(0 + cldbl);
- /* expect+1: 'long double _Complex' */
+ /* expect+1: ... 'long double _Complex' ... */
sink(cldbl + cdbl);
- /* expect+1: 'long double _Complex' */
+ /* expect+1: ... 'long double _Complex' ... */
sink(cdbl + cldbl);
- /* expect+1: 'double _Complex' */
+ /* expect+1: ... 'double _Complex' ... */
sink(cdbl + 0);
- /* expect+1: 'double _Complex' */
+ /* expect+1: ... 'double _Complex' ... */
sink(0 + cdbl);
- /* expect+1: 'double _Complex' */
+ /* expect+1: ... 'double _Complex' ... */
sink(cdbl + cflt);
- /* expect+1: 'double _Complex' */
+ /* expect+1: ... 'double _Complex' ... */
sink(cflt + cdbl);
- /* expect+1: 'float _Complex' */
+ /* expect+1: ... 'float _Complex' ... */
sink(cflt + 0);
- /* expect+1: 'float _Complex' */
+ /* expect+1: ... 'float _Complex' ... */
sink(0 + cflt);
- /* expect+1: 'float _Complex' */
+ /* expect+1: ... 'float _Complex' ... */
sink(cflt + (__uint128_t)0);
- /* expect+1: 'float _Complex' */
+ /* expect+1: ... 'float _Complex' ... */
sink((__uint128_t)0 + cflt);
/*
* The type specifier '_Complex' is only used during parsing, it does
* not make it to the expression.
*/
- /* expect+1: 'double _Complex' */
+ /* expect+1: ... 'double _Complex' ... */
sink(invalid + 0);
- /* expect+1: 'long double' */
+ /* expect+1: ... 'long double' ... */
sink(0.0L + 0);
- /* expect+1: 'long double' */
+ /* expect+1: ... 'long double' ... */
sink(0 + 0.0L);
- /* expect+1: 'long double' */
+ /* expect+1: ... 'long double' ... */
sink(0.0L + 0.0);
- /* expect+1: 'long double' */
+ /* expect+1: ... 'long double' ... */
sink(0.0 + 0.0L);
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink(0.0 + 0);
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink(0 + 0.0);
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink(0.0 + 0.0f);
- /* expect+1: 'double' */
+ /* expect+1: ... 'double' ... */
sink(0.0f + 0.0);
- /* expect+1: 'float' */
+ /* expect+1: ... 'float' ... */
sink(0.0f + 0);
- /* expect+1: 'float' */
+ /* expect+1: ... 'float' ... */
sink(0 + 0.0f);
- /* expect+1: 'float' */
+ /* expect+1: ... 'float' ... */
sink(0.0f + (__uint128_t)0);
- /* expect+1: 'float' */
+ /* expect+1: ... 'float' ... */
sink((__uint128_t)0 + 0.0f);
- /* expect+1: 'unsigned long long' */
+ /* expect+1: ... 'unsigned long long' ... */
sink(0ULL + 0);
- /* expect+1: 'unsigned long long' */
+ /* expect+1: ... 'unsigned long long' ... */
sink(0 + 0ULL);
- /* expect+1: 'unsigned long long' */
+ /* expect+1: ... 'unsigned long long' ... */
sink(0ULL + 0LL);
- /* expect+1: 'unsigned long long' */
+ /* expect+1: ... 'unsigned long long' ... */
sink(0LL + 0ULL);
/* If the bit-width is the same, prefer the unsigned variant. */
- /* expect+1: 'unsigned long long' */
+ /* expect+1: ... 'unsigned long long' ... */
sink(0UL + 0LL);
- /* expect+1: 'unsigned long long' */
+ /* expect+1: ... 'unsigned long long' ... */
sink(0LL + 0UL);
/*
* Ensure that __int128_t is listed in the integer ranks. This table
* only becomes relevant when both operands have the same width.
*/
- /* expect+1: '__uint128_t' */
+ /* expect+1: ... '__uint128_t' ... */
sink((__uint128_t)1 + (__int128_t)1);
- /* expect+1: '__uint128_t' */
+ /* expect+1: ... '__uint128_t' ... */
sink((__int128_t)1 + (__uint128_t)1);
}
Index: src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.5 src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.6
--- src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c:1.5 Sat Jun 11 11:52:13 2022
+++ src/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_init_compound_literal.c,v 1.5 2022/06/11 11:52:13 rillig Exp $ */
+/* $NetBSD: gcc_init_compound_literal.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "gcc_init_compound_literal.c"
/*
@@ -37,7 +37,7 @@ struct node {
* Initial tree for representing the decisions in the classic number guessing
* game often used in teaching the basics of programming.
*/
-/* expect+1: static variable 'guess' unused */
+/* expect+1: warning: static variable 'guess' unused [226] */
static const struct node guess = {
50,
&(struct node){
Index: src/tests/usr.bin/xlint/lint1/lex_char.c
diff -u src/tests/usr.bin/xlint/lint1/lex_char.c:1.5 src/tests/usr.bin/xlint/lint1/lex_char.c:1.6
--- src/tests/usr.bin/xlint/lint1/lex_char.c:1.5 Fri Apr 1 21:12:42 2022
+++ src/tests/usr.bin/xlint/lint1/lex_char.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_char.c,v 1.5 2022/04/01 21:12:42 rillig Exp $ */
+/* $NetBSD: lex_char.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_char.c"
/*
@@ -12,7 +12,7 @@ void sink(char);
void
test(void)
{
- /* expect+1: empty character constant */
+ /* expect+1: error: empty character constant [73] */
sink('');
sink('a');
@@ -20,12 +20,12 @@ test(void)
sink('\0');
/* UTF-8 */
- /* expect+2: multi-character character constant */
- /* expect+1: conversion of 'int' to 'char' is out of range */
+ /* expect+2: warning: multi-character character constant [294] */
+ /* expect+1: warning: conversion of 'int' to 'char' is out of range, arg #1 [295] */
sink('ä');
/* GCC extension */
- /* expect+1: dubious escape \e */
+ /* expect+1: warning: dubious escape \e [79] */
sink('\e');
/* since C99 */
@@ -34,7 +34,7 @@ test(void)
/* octal */
sink('\177');
- /* expect+1: empty character constant */
+ /* expect+1: error: empty character constant [73] */
sink('');
/* U+0007 alarm/bell */
Index: src/tests/usr.bin/xlint/lint1/msg_034.c
diff -u src/tests/usr.bin/xlint/lint1/msg_034.c:1.5 src/tests/usr.bin/xlint/lint1/msg_034.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_034.c:1.5 Sun May 16 11:11:37 2021
+++ src/tests/usr.bin/xlint/lint1/msg_034.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_034.c,v 1.5 2021/05/16 11:11:37 rillig Exp $ */
+/* $NetBSD: msg_034.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_034.c"
// Test for message: nonportable bit-field type '%s' [34]
@@ -17,10 +17,10 @@
* typedef-types for bit-fields.
*/
struct example {
- /* expect+1: 34 */
+ /* expect+1: warning: nonportable bit-field type 'unsigned short' [34] */
unsigned short ushort: 1;
- /* expect+1: 344 */
+ /* expect+1: warning: bit-field of type plain 'int' has implementation-defined signedness [344] */
int plain_int: 1;
signed int signed_int: 1;
Index: src/tests/usr.bin/xlint/lint1/msg_066.c
diff -u src/tests/usr.bin/xlint/lint1/msg_066.c:1.5 src/tests/usr.bin/xlint/lint1/msg_066.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_066.c:1.5 Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_066.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_066.c,v 1.5 2021/08/26 19:23:25 rillig Exp $ */
+/* $NetBSD: msg_066.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_066.c"
// Test for message: syntax requires ';' after last struct/union member [66]
@@ -12,5 +12,5 @@
struct number {
int value
};
-/* expect-1: syntax error '}' [249] */
+/* expect-1: error: syntax error '}' [249] */
/* expect+1: error: cannot recover from previous errors [224] */
Index: src/tests/usr.bin/xlint/lint1/msg_077.c
diff -u src/tests/usr.bin/xlint/lint1/msg_077.c:1.5 src/tests/usr.bin/xlint/lint1/msg_077.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_077.c:1.5 Wed Jun 15 20:18:31 2022
+++ src/tests/usr.bin/xlint/lint1/msg_077.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_077.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */
+/* $NetBSD: msg_077.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_077.c"
/* Test for message: bad octal digit %c [77] */
@@ -23,5 +23,5 @@ char single_digit = '\8';
* anyway.
* https://mail-index.netbsd.org/tech-toolchain/2021/03/16/msg003933.html
*/
-/* expect+1: multi-character character constant [294] */
+/* expect+1: warning: multi-character character constant [294] */
char several_digits = '\08';
Index: src/tests/usr.bin/xlint/lint1/msg_118.c
diff -u src/tests/usr.bin/xlint/lint1/msg_118.c:1.5 src/tests/usr.bin/xlint/lint1/msg_118.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_118.c:1.5 Tue May 4 19:57:56 2021
+++ src/tests/usr.bin/xlint/lint1/msg_118.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_118.c,v 1.5 2021/05/04 19:57:56 rillig Exp $ */
+/* $NetBSD: msg_118.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_118.c"
/* Test for message: semantics of '%s' change in ANSI C; use explicit cast [118] */
@@ -14,7 +14,7 @@ int_shl_uint(int left, unsigned int righ
int
int_shr_uint(int left, unsigned int right)
{
- /* expect+1: semantics of '>>' change in ANSI C */
+ /* expect+1: warning: semantics of '>>' change in ANSI C; use explicit cast [118] */
return left >> right;
}
Index: src/tests/usr.bin/xlint/lint1/msg_189.c
diff -u src/tests/usr.bin/xlint/lint1/msg_189.c:1.5 src/tests/usr.bin/xlint/lint1/msg_189.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_189.c:1.5 Thu Aug 26 19:23:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_189.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_189.c,v 1.5 2021/08/26 19:23:25 rillig Exp $ */
+/* $NetBSD: msg_189.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_189.c"
/* Test for message: assignment of struct/union illegal in traditional C [189] */
@@ -17,5 +17,5 @@ example()
a.member = 3;
b = a; /* message 189 is not triggered anymore */
- /* expect-1: 'b' set but not used in function 'example' */
+ /* expect-1: warning: 'b' set but not used in function 'example' [191] */
}
Index: src/tests/usr.bin/xlint/lint1/msg_232.c
diff -u src/tests/usr.bin/xlint/lint1/msg_232.c:1.5 src/tests/usr.bin/xlint/lint1/msg_232.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_232.c:1.5 Sun Jul 11 19:30:56 2021
+++ src/tests/usr.bin/xlint/lint1/msg_232.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_232.c,v 1.5 2021/07/11 19:30:56 rillig Exp $ */
+/* $NetBSD: msg_232.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_232.c"
// Test for message: label '%s' unused in function '%s' [232]
@@ -7,7 +7,7 @@ void
example(void)
{
goto used_label;
- /* expect+1: label 'unused_label' unused in function 'example' [232] */
+ /* expect+1: warning: label 'unused_label' unused in function 'example' [232] */
unused_label:
return;
used_label:
Index: src/tests/usr.bin/xlint/lint1/expr_precedence.c
diff -u src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.8 src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.9
--- src/tests/usr.bin/xlint/lint1/expr_precedence.c:1.8 Tue Nov 16 17:41:23 2021
+++ src/tests/usr.bin/xlint/lint1/expr_precedence.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: expr_precedence.c,v 1.8 2021/11/16 17:41:23 rillig Exp $ */
+/* $NetBSD: expr_precedence.c,v 1.9 2022/06/17 18:54:53 rillig Exp $ */
# 3 "expr_precedence.c"
/*
@@ -31,7 +31,7 @@ void __attribute__((format(printf,
* See lex.c, function 'search', keyword 'in_gcc_attribute'.
*/
/* expect+2: error: 'var' undefined [99] */
- /* expect+1: syntax error '=' [249] */
+ /* expect+1: error: syntax error '=' [249] */
var = 1,
/* Syntactically ok, must be a constant expression though. */
var > 0 ? 2 : 1)))
Index: src/tests/usr.bin/xlint/lint1/parse_type_name.c
diff -u src/tests/usr.bin/xlint/lint1/parse_type_name.c:1.8 src/tests/usr.bin/xlint/lint1/parse_type_name.c:1.9
--- src/tests/usr.bin/xlint/lint1/parse_type_name.c:1.8 Fri Apr 1 23:16:32 2022
+++ src/tests/usr.bin/xlint/lint1/parse_type_name.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: parse_type_name.c,v 1.8 2022/04/01 23:16:32 rillig Exp $ */
+/* $NetBSD: parse_type_name.c,v 1.9 2022/06/17 18:54:53 rillig Exp $ */
# 3 "parse_type_name.c"
/*
@@ -114,15 +114,15 @@ cover_abstract_decl_param_list(void)
sink(sizeof(void (*)(void) __attribute__(()) __attribute__(())));
/* cover 'abstract_decl_lparen error T_RPAREN type_attribute_opt' */
- /* expect+1: syntax error 'goto' [249] */
+ /* expect+1: error: syntax error 'goto' [249] */
sink(sizeof(void (*)(goto)));
- /* expect+1: syntax error 'goto' [249] */
+ /* expect+1: error: syntax error 'goto' [249] */
sink(sizeof(void (*)(goto) __attribute__(())));
/*
* XXX: The grammar allows only a single type_attribute_opt.
* All following __attribute__ come from direct_abstract_declarator.
*/
- /* expect+1: syntax error 'goto' [249] */
+ /* expect+1: error: syntax error 'goto' [249] */
sink(sizeof(void (*)(goto) __attribute__(()) __attribute__(())));
}
Index: src/tests/usr.bin/xlint/lint1/feat_stacktrace.c
diff -u src/tests/usr.bin/xlint/lint1/feat_stacktrace.c:1.2 src/tests/usr.bin/xlint/lint1/feat_stacktrace.c:1.3
--- src/tests/usr.bin/xlint/lint1/feat_stacktrace.c:1.2 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/feat_stacktrace.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: feat_stacktrace.c,v 1.2 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: feat_stacktrace.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "feat_stacktrace.c"
/*
@@ -23,7 +23,7 @@
* the main file as well.
*/
# 1 "common_int_types.h" 1 3 4
-/* expect+1: typedef declares no type name [72] */
+/* expect+1: warning: typedef declares no type name [72] */
typedef int;
# 39 "common_int_types.h" 3 4
# 39 "/usr/include/amd64/int_types.h" 2 3 4
Index: src/tests/usr.bin/xlint/lint1/gcc_attribute_aligned.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_attribute_aligned.c:1.2 src/tests/usr.bin/xlint/lint1/gcc_attribute_aligned.c:1.3
--- src/tests/usr.bin/xlint/lint1/gcc_attribute_aligned.c:1.2 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/gcc_attribute_aligned.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_attribute_aligned.c,v 1.2 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: gcc_attribute_aligned.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "gcc_attribute_aligned.c"
/*
@@ -40,6 +40,6 @@ struct {
unsigned int sizeof_fpacc87: sizeof(struct fpacc87) == 10 ? 1 : -1;
/* FIXME: @4 2 + @4 2 + @4 2 + @4 8 + @4 8 + @2 (8 * 10) == 108 */
- /* expect+1: illegal bit-field size: 255 */
+ /* expect+1: error: illegal bit-field size: 255 [36] */
unsigned int sizeof_save87: sizeof(struct save87) == 108 ? 1 : -1;
};
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.2 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.2 Mon May 3 05:24:44 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_typeof_after_statement.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_typeof_after_statement.c,v 1.2 2021/05/03 05:24:44 rillig Exp $ */
+/* $NetBSD: gcc_typeof_after_statement.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "gcc_typeof_after_statement.c"
/*
@@ -18,5 +18,5 @@ example(void **ptr)
}
/* Just to keep the .exp file. */
-/* expect+1: static function unused declared but not defined */
+/* expect+1: warning: static function unused declared but not defined [290] */
static void unused(void);
Index: src/tests/usr.bin/xlint/lint1/lex_wide_char.c
diff -u src/tests/usr.bin/xlint/lint1/lex_wide_char.c:1.2 src/tests/usr.bin/xlint/lint1/lex_wide_char.c:1.3
--- src/tests/usr.bin/xlint/lint1/lex_wide_char.c:1.2 Sun Jun 20 18:38:12 2021
+++ src/tests/usr.bin/xlint/lint1/lex_wide_char.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_wide_char.c,v 1.2 2021/06/20 18:38:12 rillig Exp $ */
+/* $NetBSD: lex_wide_char.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_wide_char.c"
/*
@@ -12,7 +12,7 @@ void sink(int);
void
test(void)
{
- /* expect+1: empty character constant */
+ /* expect+1: error: empty character constant [73] */
sink(L'');
sink(L'a');
@@ -20,11 +20,11 @@ test(void)
sink(L'\0');
/* UTF-8 */
- /* expect+1: too many characters in character constant */
+ /* expect+1: error: too many characters in character constant [71] */
sink(L'ä');
/* GCC extension */
- /* expect+1: dubious escape \e */
+ /* expect+1: warning: dubious escape \e [79] */
sink(L'\e');
/* since C99 */
@@ -36,6 +36,6 @@ test(void)
/* newline */
sink(L'\n');
- /* expect+1: empty character constant */
+ /* expect+1: error: empty character constant [73] */
sink(L'');
}
Index: src/tests/usr.bin/xlint/lint1/lex_wide_string.c
diff -u src/tests/usr.bin/xlint/lint1/lex_wide_string.c:1.2 src/tests/usr.bin/xlint/lint1/lex_wide_string.c:1.3
--- src/tests/usr.bin/xlint/lint1/lex_wide_string.c:1.2 Mon Aug 23 17:47:34 2021
+++ src/tests/usr.bin/xlint/lint1/lex_wide_string.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_wide_string.c,v 1.2 2021/08/23 17:47:34 rillig Exp $ */
+/* $NetBSD: lex_wide_string.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_wide_string.c"
/*
@@ -20,10 +20,10 @@ test(void)
sink(L"\0\0\0\0");
- /* expect+1: no hex digits follow \x [74] */
+ /* expect+1: error: no hex digits follow \x [74] */
sink(L"\x");
- /* expect+1: dubious escape \y [79] */
+ /* expect+1: warning: dubious escape \y [79] */
sink(L"\y");
sink(L"first" L"second");
Index: src/tests/usr.bin/xlint/lint1/msg_345.c
diff -u src/tests/usr.bin/xlint/lint1/msg_345.c:1.2 src/tests/usr.bin/xlint/lint1/msg_345.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_345.c:1.2 Sun Jun 27 20:47:13 2021
+++ src/tests/usr.bin/xlint/lint1/msg_345.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_345.c,v 1.2 2021/06/27 20:47:13 rillig Exp $ */
+/* $NetBSD: msg_345.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_345.c"
// Test for message: generic selection requires C11 or later [345]
@@ -9,6 +9,6 @@
int
test(int x)
{
- /* expect+1: generic selection requires C11 or later [345] */
+ /* expect+1: error: generic selection requires C11 or later [345] */
return _Generic(x, default: 3) + x;
}
Index: src/tests/usr.bin/xlint/lint1/op_colon.c
diff -u src/tests/usr.bin/xlint/lint1/op_colon.c:1.2 src/tests/usr.bin/xlint/lint1/op_colon.c:1.3
--- src/tests/usr.bin/xlint/lint1/op_colon.c:1.2 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/op_colon.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: op_colon.c,v 1.2 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: op_colon.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "op_colon.c"
/*
@@ -14,37 +14,37 @@ test_merge_qualifiers(_Bool cond, int *p
const volatile int *cv)
{
sink(cond ? p : p);
- /* expect+1: 'pointer to const int' */
+ /* expect+1: ... 'pointer to const int' ... */
sink(cond ? p : c);
- /* expect+1: 'pointer to volatile int' */
+ /* expect+1: ... 'pointer to volatile int' ... */
sink(cond ? p : v);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? p : cv);
- /* expect+1: 'pointer to const int' */
+ /* expect+1: ... 'pointer to const int' ... */
sink(cond ? c : p);
- /* expect+1: 'pointer to const int' */
+ /* expect+1: ... 'pointer to const int' ... */
sink(cond ? c : c);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? c : v);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? c : cv);
- /* expect+1: 'pointer to volatile int' */
+ /* expect+1: ... 'pointer to volatile int' ... */
sink(cond ? v : p);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? v : c);
- /* expect+1: 'pointer to volatile int' */
+ /* expect+1: ... 'pointer to volatile int' ... */
sink(cond ? v : v);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? v : cv);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? cv : p);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? cv : c);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? cv : v);
- /* expect+1: 'pointer to const volatile int' */
+ /* expect+1: ... 'pointer to const volatile int' ... */
sink(cond ? cv : cv);
}
Index: src/tests/usr.bin/xlint/lint1/stmt_for.c
diff -u src/tests/usr.bin/xlint/lint1/stmt_for.c:1.2 src/tests/usr.bin/xlint/lint1/stmt_for.c:1.3
--- src/tests/usr.bin/xlint/lint1/stmt_for.c:1.2 Sat Jan 15 14:22:03 2022
+++ src/tests/usr.bin/xlint/lint1/stmt_for.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: stmt_for.c,v 1.2 2022/01/15 14:22:03 rillig Exp $ */
+/* $NetBSD: stmt_for.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */
# 3 "stmt_for.c"
/*
@@ -14,4 +14,4 @@ test(void)
for (0 0;
}
-/* expect+1: cannot recover from previous errors */
+/* expect+1: error: cannot recover from previous errors [224] */
Index: src/tests/usr.bin/xlint/lint1/gcc_attribute_enum.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_attribute_enum.c:1.4 src/tests/usr.bin/xlint/lint1/gcc_attribute_enum.c:1.5
--- src/tests/usr.bin/xlint/lint1/gcc_attribute_enum.c:1.4 Sun Jul 25 18:48:47 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_attribute_enum.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_attribute_enum.c,v 1.4 2021/07/25 18:48:47 rillig Exp $ */
+/* $NetBSD: gcc_attribute_enum.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "gcc_attribute_enum.c"
/*
@@ -37,7 +37,7 @@ enum without_initializer {
enum with_initializer {
INIT_FIRST __attribute__(()) = 1,
INIT_LAST __attribute__(()) = 2,
- /* expect+1: syntax error '__attribute__' [249] */
+ /* expect+1: error: syntax error '__attribute__' [249] */
INIT_WRONG = 3 __attribute__(()),
};
Index: src/tests/usr.bin/xlint/lint1/lex_string.c
diff -u src/tests/usr.bin/xlint/lint1/lex_string.c:1.4 src/tests/usr.bin/xlint/lint1/lex_string.c:1.5
--- src/tests/usr.bin/xlint/lint1/lex_string.c:1.4 Sat Nov 20 17:27:46 2021
+++ src/tests/usr.bin/xlint/lint1/lex_string.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_string.c,v 1.4 2021/11/20 17:27:46 rillig Exp $ */
+/* $NetBSD: lex_string.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_string.c"
/*
@@ -20,10 +20,10 @@ test(void)
sink("\0\0\0\0");
- /* expect+1: no hex digits follow \x [74] */
+ /* expect+1: error: no hex digits follow \x [74] */
sink("\x"); /* unfinished */
- /* expect+1: dubious escape \y [79] */
+ /* expect+1: warning: dubious escape \y [79] */
sink("\y"); /* unknown escape sequence */
sink("first" "second");
Index: src/tests/usr.bin/xlint/lint1/msg_005.c
diff -u src/tests/usr.bin/xlint/lint1/msg_005.c:1.4 src/tests/usr.bin/xlint/lint1/msg_005.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_005.c:1.4 Sat Sep 4 13:45:37 2021
+++ src/tests/usr.bin/xlint/lint1/msg_005.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_005.c,v 1.4 2021/09/04 13:45:37 rillig Exp $ */
+/* $NetBSD: msg_005.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_005.c"
// Test for message: modifying typedef with '%s'; only qualifiers allowed [5]
@@ -14,7 +14,7 @@ typedef number unsigned unsigned_number;
/* expect+1: warning: modifying typedef with 'short'; only qualifiers allowed [5] */
typedef number short short_number;
-/* expect+1: modifying typedef with 'long'; only qualifiers allowed [5] */
+/* expect+1: warning: modifying typedef with 'long'; only qualifiers allowed [5] */
typedef number long long_number;
/*
Index: src/tests/usr.bin/xlint/lint1/msg_041.c
diff -u src/tests/usr.bin/xlint/lint1/msg_041.c:1.4 src/tests/usr.bin/xlint/lint1/msg_041.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_041.c:1.4 Mon Feb 7 02:44:49 2022
+++ src/tests/usr.bin/xlint/lint1/msg_041.c Fri Jun 17 18:54:53 2022
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_041.c,v 1.4 2022/02/07 02:44:49 rillig Exp $ */
+/* $NetBSD: msg_041.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_041.c"
// Test for message: bit-field in union is very unusual [41]
union u {
int member;
- /* expect+1: bit-field in union is very unusual [41] */
+ /* expect+1: warning: bit-field in union is very unusual [41] */
unsigned bit_field : 7;
};
Index: src/tests/usr.bin/xlint/lint1/msg_048.c
diff -u src/tests/usr.bin/xlint/lint1/msg_048.c:1.4 src/tests/usr.bin/xlint/lint1/msg_048.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_048.c:1.4 Fri Apr 8 21:48:19 2022
+++ src/tests/usr.bin/xlint/lint1/msg_048.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_048.c,v 1.4 2022/04/08 21:48:19 rillig Exp $ */
+/* $NetBSD: msg_048.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_048.c"
// Test for message: overflow in enumeration values: %s [48]
@@ -16,7 +16,7 @@ enum int_limits {
MAX_MINUS_2 = 0x7ffffffd,
MAX_MINUS_1,
MAX,
- /* expect+1: overflow in enumeration values: MIN [48] */
+ /* expect+1: warning: overflow in enumeration values: MIN [48] */
MIN,
MIN_PLUS_1
};
Index: src/tests/usr.bin/xlint/lint1/msg_080.c
diff -u src/tests/usr.bin/xlint/lint1/msg_080.c:1.4 src/tests/usr.bin/xlint/lint1/msg_080.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_080.c:1.4 Sun Jul 4 13:44:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_080.c Fri Jun 17 18:54:53 2022
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_080.c,v 1.4 2021/07/04 13:44:43 rillig Exp $ */
+/* $NetBSD: msg_080.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_080.c"
// Test for message: dubious escape \%o [80]
-/* expect+1: dubious escape \177 [80] */
+/* expect+1: warning: dubious escape \177 [80] */
char backslash_delete = '\';
Index: src/tests/usr.bin/xlint/lint1/msg_184.c
diff -u src/tests/usr.bin/xlint/lint1/msg_184.c:1.4 src/tests/usr.bin/xlint/lint1/msg_184.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_184.c:1.4 Sat Aug 14 13:00:55 2021
+++ src/tests/usr.bin/xlint/lint1/msg_184.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_184.c,v 1.4 2021/08/14 13:00:55 rillig Exp $ */
+/* $NetBSD: msg_184.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_184.c"
// Test for message: illegal combination of '%s' and '%s' [184]
@@ -6,6 +6,6 @@
int *
example(char *cp)
{
- /* expect+1: illegal combination of 'pointer to int' and 'pointer to char' [184] */
+ /* expect+1: warning: illegal combination of 'pointer to int' and 'pointer to char' [184] */
return cp;
}
Index: src/tests/usr.bin/xlint/lint1/msg_250.c
diff -u src/tests/usr.bin/xlint/lint1/msg_250.c:1.4 src/tests/usr.bin/xlint/lint1/msg_250.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_250.c:1.4 Sun Apr 24 20:08:23 2022
+++ src/tests/usr.bin/xlint/lint1/msg_250.c Fri Jun 17 18:54:53 2022
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_250.c,v 1.4 2022/04/24 20:08:23 rillig Exp $ */
+/* $NetBSD: msg_250.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_250.c"
// Test for message: unknown character \%o [250]
-/* expect+1: unknown character \100 [250] */
+/* expect+1: error: unknown character \100 [250] */
@deprecated
/* expect+2: error: old style declaration; add 'int' [1] */
-/* expect+1: syntax error 'char' [249] */
+/* expect+1: error: syntax error 'char' [249] */
char *gets(void);
Index: src/tests/usr.bin/xlint/lint1/msg_265.c
diff -u src/tests/usr.bin/xlint/lint1/msg_265.c:1.4 src/tests/usr.bin/xlint/lint1/msg_265.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_265.c:1.4 Wed Dec 22 14:25:35 2021
+++ src/tests/usr.bin/xlint/lint1/msg_265.c Fri Jun 17 18:54:53 2022
@@ -1,16 +1,16 @@
-/* $NetBSD: msg_265.c,v 1.4 2021/12/22 14:25:35 rillig Exp $ */
+/* $NetBSD: msg_265.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_265.c"
/* Test for message: %s does not support 'long long' [265] */
/* lint1-flags: -w */
-/* expect+1: C90 does not support 'long long' [265] */
+/* expect+1: warning: C90 does not support 'long long' [265] */
long long unsupported_variable;
/*LONGLONG*/
long long suppressed_variable,
second_suppressed_variable;
-/* expect+1: C90 does not support 'long long' [265] */
+/* expect+1: warning: C90 does not support 'long long' [265] */
long long another_unsupported_variable;
Index: src/tests/usr.bin/xlint/lint1/msg_333.c
diff -u src/tests/usr.bin/xlint/lint1/msg_333.c:1.4 src/tests/usr.bin/xlint/lint1/msg_333.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_333.c:1.4 Sun Jul 4 07:09:39 2021
+++ src/tests/usr.bin/xlint/lint1/msg_333.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_333.c,v 1.4 2021/07/04 07:09:39 rillig Exp $ */
+/* $NetBSD: msg_333.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_333.c"
// Test for message: controlling expression must be bool, not '%s' [333]
@@ -16,11 +16,11 @@ example(bool b, int i, const char *p)
if (b)
return "bool";
- /* expect+1: must be bool, not 'int' [333] */
+ /* expect+1: error: controlling expression must be bool, not 'int' [333] */
if (i)
return "int";
- /* expect+1: must be bool, not 'pointer' [333] */
+ /* expect+1: error: controlling expression must be bool, not 'pointer' [333] */
if (p)
return "pointer";
@@ -29,7 +29,7 @@ example(bool b, int i, const char *p)
return "bool constant";
}
- /* expect+1: controlling expression must be bool, not 'int' [333] */
+ /* expect+1: error: controlling expression must be bool, not 'int' [333] */
if (0) {
/* expect+1: warning: statement not reached [193] */
return "integer constant";
Index: src/tests/usr.bin/xlint/lint1/gcc_stmt_asm.c
diff -u src/tests/usr.bin/xlint/lint1/gcc_stmt_asm.c:1.3 src/tests/usr.bin/xlint/lint1/gcc_stmt_asm.c:1.4
--- src/tests/usr.bin/xlint/lint1/gcc_stmt_asm.c:1.3 Wed Jul 21 21:04:00 2021
+++ src/tests/usr.bin/xlint/lint1/gcc_stmt_asm.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gcc_stmt_asm.c,v 1.3 2021/07/21 21:04:00 rillig Exp $ */
+/* $NetBSD: gcc_stmt_asm.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "gcc_stmt_asm.c"
/*
@@ -33,7 +33,7 @@ __asm__();
void
syntax_error(void)
{
- /* expect+1: syntax error '__asm__' [249] */
+ /* expect+1: error: syntax error '__asm__' [249] */
int i = __asm__();
}
Index: src/tests/usr.bin/xlint/lint1/init_c90.c
diff -u src/tests/usr.bin/xlint/lint1/init_c90.c:1.3 src/tests/usr.bin/xlint/lint1/init_c90.c:1.4
--- src/tests/usr.bin/xlint/lint1/init_c90.c:1.3 Sun Feb 27 11:40:30 2022
+++ src/tests/usr.bin/xlint/lint1/init_c90.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: init_c90.c,v 1.3 2022/02/27 11:40:30 rillig Exp $ */
+/* $NetBSD: init_c90.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "init_c90.c"
/*
@@ -25,6 +25,6 @@ struct point points_c99[] = {[3] = { 0,
struct point
compound_literal(void) {
- /* expect+1: compound literals are a C99/GCC extension [319] */
+ /* expect+1: error: compound literals are a C99/GCC extension [319] */
return (struct point){ 0, 0 };
}
Index: src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c
diff -u src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.3 src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.4
--- src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c:1.3 Sat Aug 21 11:50:57 2021
+++ src/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_integer_ilp32.c,v 1.3 2021/08/21 11:50:57 rillig Exp $ */
+/* $NetBSD: lex_integer_ilp32.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_integer_ilp32.c"
/*
@@ -22,13 +22,13 @@ test_signed_int(void)
sinki(2147483647);
- /* expect+1: 'unsigned long' to 'int' is out of range, arg #1 [295] */
+ /* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
sinki(2147483648);
sinki(-2147483647);
- /* expect+2: ANSI C treats constant as unsigned, op - [218] */
- /* expect+1: 'unsigned long' to 'int' is out of range, arg #1 [295] */
+ /* 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);
}
@@ -39,6 +39,6 @@ test_unsigned_int(void)
sinku(4294967295U);
- /* expect+1: integer constant out of range [252] */
+ /* expect+1: warning: integer constant out of range [252] */
sinku(4294967296U);
}
Index: src/tests/usr.bin/xlint/lint1/msg_069.c
diff -u src/tests/usr.bin/xlint/lint1/msg_069.c:1.3 src/tests/usr.bin/xlint/lint1/msg_069.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_069.c:1.3 Fri Apr 8 21:29:29 2022
+++ src/tests/usr.bin/xlint/lint1/msg_069.c Fri Jun 17 18:54:53 2022
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_069.c,v 1.3 2022/04/08 21:29:29 rillig Exp $ */
+/* $NetBSD: msg_069.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_069.c"
// Test for message: inappropriate qualifiers with 'void' [69]
/* expect+2: error: void type for 'const_void' [19] */
-/* expect+1: warning: inappropriate qualifiers with 'void' */
+/* expect+1: warning: inappropriate qualifiers with 'void' [69] */
const void const_void;
/* expect+2: error: void type for 'volatile_void' [19] */
-/* expect+1: warning: inappropriate qualifiers with 'void' */
+/* expect+1: warning: inappropriate qualifiers with 'void' [69] */
volatile void volatile_void;
Index: src/tests/usr.bin/xlint/lint1/msg_103.c
diff -u src/tests/usr.bin/xlint/lint1/msg_103.c:1.3 src/tests/usr.bin/xlint/lint1/msg_103.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_103.c:1.3 Sun Jul 4 17:01:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_103.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_103.c,v 1.3 2021/07/04 17:01:58 rillig Exp $ */
+/* $NetBSD: msg_103.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_103.c"
// Test for message: left operand of '.' must be struct or union, not '%s' [103]
@@ -11,6 +11,6 @@ void
test(struct point pt, struct point *ptr)
{
pt.x = 0;
- /* expect+1: left operand of '.' must be struct or union, not 'pointer to struct point' [103] */
+ /* expect+1: error: left operand of '.' must be struct or union, not 'pointer to struct point' [103] */
ptr.y = 0;
}
Index: src/tests/usr.bin/xlint/lint1/msg_104.c
diff -u src/tests/usr.bin/xlint/lint1/msg_104.c:1.3 src/tests/usr.bin/xlint/lint1/msg_104.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_104.c:1.3 Sun Jul 4 17:01:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_104.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_104.c,v 1.3 2021/07/04 17:01:58 rillig Exp $ */
+/* $NetBSD: msg_104.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_104.c"
// Test for message: left operand of '->' must be pointer to struct or union, not '%s' [104]
@@ -11,7 +11,7 @@ struct point {
void
test(struct point pt, struct point *ptr)
{
- /* expect+1: left operand of '->' must be pointer to struct or union, not 'struct point' [104] */
+ /* expect+1: error: left operand of '->' must be pointer to struct or union, not 'struct point' [104] */
pt->x = 0;
ptr->y = 0;
}
Index: src/tests/usr.bin/xlint/lint1/msg_211.c
diff -u src/tests/usr.bin/xlint/lint1/msg_211.c:1.3 src/tests/usr.bin/xlint/lint1/msg_211.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_211.c:1.3 Mon Aug 16 18:51:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_211.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_211.c,v 1.3 2021/08/16 18:51:58 rillig Exp $ */
+/* $NetBSD: msg_211.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_211.c"
// Test for message: return value type mismatch (%s) and (%s) [211]
@@ -16,7 +16,7 @@ return_int(double dbl, void *ptr, struct
/* 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: return value type mismatch (int) and (struct str) [211] */
return str;
return 3;
}
Index: src/tests/usr.bin/xlint/lint1/msg_251.c
diff -u src/tests/usr.bin/xlint/lint1/msg_251.c:1.3 src/tests/usr.bin/xlint/lint1/msg_251.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_251.c:1.3 Tue Jun 29 07:17:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_251.c Fri Jun 17 18:54:53 2022
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_251.c,v 1.3 2021/06/29 07:17:43 rillig Exp $ */
+/* $NetBSD: msg_251.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_251.c"
// Test for message: malformed integer constant [251]
-/* expect+1: malformed integer constant */
+/* expect+1: warning: malformed integer constant [251] */
int lll = 123LLL;
-/* expect+1: malformed integer constant */
+/* expect+1: warning: malformed integer constant [251] */
unsigned int uu = 123UU;
Index: src/tests/usr.bin/xlint/lint1/msg_253.c
diff -u src/tests/usr.bin/xlint/lint1/msg_253.c:1.3 src/tests/usr.bin/xlint/lint1/msg_253.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_253.c:1.3 Tue Jun 29 07:17:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_253.c Fri Jun 17 18:54:53 2022
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_253.c,v 1.3 2021/06/29 07:17:43 rillig Exp $ */
+/* $NetBSD: msg_253.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_253.c"
// Test for message: unterminated character constant [253]
-/* expect+3: [253] */
-/* expect+2: syntax error '' */
+/* expect+3: error: unterminated character constant [253] */
+/* expect+2: error: syntax error '' [249] */
'
Index: src/tests/usr.bin/xlint/lint1/msg_254.c
diff -u src/tests/usr.bin/xlint/lint1/msg_254.c:1.3 src/tests/usr.bin/xlint/lint1/msg_254.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_254.c:1.3 Tue Jun 29 07:17:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_254.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_254.c,v 1.3 2021/06/29 07:17:43 rillig Exp $ */
+/* $NetBSD: msg_254.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_254.c"
/* Test for message: newline in string or char constant [254] */
@@ -10,10 +10,10 @@
* C99 does not allow it.
*/
-/* expect+6: newline in string or char constant [254] */
-/* expect+5: unterminated string constant [258] */
-/* expect+4: syntax error '"' [249] */
-/* expect+4: newline in string or char constant [254] */
-/* expect+3: unterminated string constant [258] */
+/* expect+6: error: newline in string or char constant [254] */
+/* expect+5: error: unterminated string constant [258] */
+/* expect+4: error: syntax error '"' [249] */
+/* expect+4: error: newline in string or char constant [254] */
+/* expect+3: error: unterminated string constant [258] */
"line1
line2"
Index: src/tests/usr.bin/xlint/lint1/msg_257.c
diff -u src/tests/usr.bin/xlint/lint1/msg_257.c:1.3 src/tests/usr.bin/xlint/lint1/msg_257.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_257.c:1.3 Fri Aug 27 20:49:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_257.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_257.c,v 1.3 2021/08/27 20:49:25 rillig Exp $ */
+/* $NetBSD: msg_257.c,v 1.4 2022/06/17 18:54:53 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: */
+/* expect+1: warning: argument number mismatch with directive: ** PRINTFLIKE ** [283] */
{
take(fmt);
}
Index: src/tests/usr.bin/xlint/lint1/msg_259_c90.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259_c90.c:1.3 src/tests/usr.bin/xlint/lint1/msg_259_c90.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_259_c90.c:1.3 Thu Sep 2 17:55:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259_c90.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_259_c90.c,v 1.3 2021/09/02 17:55:27 rillig Exp $ */
+/* $NetBSD: msg_259_c90.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_259_c90.c"
/* Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] */
@@ -47,7 +47,7 @@ change_in_type_width(char c, int i, long
signed_long(i);
plain_char(l); /* XXX: why no warning? */
- /* expect+1: from 'long' to 'int' due to prototype [259] */
+ /* expect+1: ... from 'long' to 'int' due to prototype [259] */
signed_int(l);
signed_long(l);
}
Index: src/tests/usr.bin/xlint/lint1/msg_283.c
diff -u src/tests/usr.bin/xlint/lint1/msg_283.c:1.3 src/tests/usr.bin/xlint/lint1/msg_283.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_283.c:1.3 Mon Aug 30 19:48:21 2021
+++ src/tests/usr.bin/xlint/lint1/msg_283.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_283.c,v 1.3 2021/08/30 19:48:21 rillig Exp $ */
+/* $NetBSD: msg_283.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_283.c"
// Test for message: argument number mismatch with directive: /* %s */ [283]
@@ -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 */
+/* expect+1: warning: argument number mismatch with directive: ** PRINTFLIKE ** [283] */
{
}
Index: src/tests/usr.bin/xlint/lint1/msg_289.c
diff -u src/tests/usr.bin/xlint/lint1/msg_289.c:1.3 src/tests/usr.bin/xlint/lint1/msg_289.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_289.c:1.3 Fri Aug 27 20:49:25 2021
+++ src/tests/usr.bin/xlint/lint1/msg_289.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_289.c,v 1.3 2021/08/27 20:49:25 rillig Exp $ */
+/* $NetBSD: msg_289.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_289.c"
// Test for message: can't be used together: /* PRINTFLIKE */ /* SCANFLIKE */ [289]
@@ -6,6 +6,6 @@
/* PRINTFLIKE */ /* SCANFLIKE */
void
both(void)
-/* expect+1: warning: can't be used together */
+/* expect+1: warning: can't be used together: ** PRINTFLIKE ** ** SCANFLIKE ** [289] */
{
}
Index: src/tests/usr.bin/xlint/lint1/msg_312.c
diff -u src/tests/usr.bin/xlint/lint1/msg_312.c:1.3 src/tests/usr.bin/xlint/lint1/msg_312.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_312.c:1.3 Wed Dec 22 14:25:35 2021
+++ src/tests/usr.bin/xlint/lint1/msg_312.c Fri Jun 17 18:54:53 2022
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_312.c,v 1.3 2021/12/22 14:25:35 rillig Exp $ */
+/* $NetBSD: msg_312.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_312.c"
/* Test for message: %s does not support // comments [312] */
/* lint1-flags: -tw */
-/* expect+1: traditional C does not support // comments [312] */
+/* expect+1: warning: traditional C does not support // comments [312] */
// C99 comment
Index: src/tests/usr.bin/xlint/lint1/msg_342.c
diff -u src/tests/usr.bin/xlint/lint1/msg_342.c:1.3 src/tests/usr.bin/xlint/lint1/msg_342.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_342.c:1.3 Sun Jul 25 22:43:08 2021
+++ src/tests/usr.bin/xlint/lint1/msg_342.c Fri Jun 17 18:54:53 2022
@@ -1,5 +1,5 @@
-/* $NetBSD: msg_342.c,v 1.3 2021/07/25 22:43:08 rillig Exp $ */
-# 3 "msg_341.c"
+/* $NetBSD: msg_342.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */
+# 3 "msg_342.c"
// Test for message: argument to '%s' must be cast to 'unsigned char', not to '%s' [342]
@@ -73,7 +73,7 @@ void
function_call_char(char c)
{
- /* expect+1: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' */
+ /* expect+1: warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341] */
(isspace)(c);
/* This is the only allowed form. */
@@ -82,10 +82,10 @@ function_call_char(char c)
/* The cast to 'int' is redundant, it doesn't hurt though. */
isspace((int)(unsigned char)c);
- /* expect+1: argument to 'isspace' must be cast to 'unsigned char', not to 'int' */
+ /* expect+1: warning: argument to 'isspace' must be cast to 'unsigned char', not to 'int' [342] */
isspace((int)c);
- /* expect+1: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' */
+ /* expect+1: warning: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' [342] */
isspace((unsigned int)c);
}
@@ -116,15 +116,15 @@ void
macro_invocation_NetBSD(char c)
{
- /* expect+1: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' */
+ /* expect+1: warning: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' [341] */
sink(((int)((_ctype_tab_ + 1)[(c)] & 0x0040)));
/* This is the only allowed form. */
sink(((int)((_ctype_tab_ + 1)[((unsigned char)c)] & 0x0040)));
- /* expect+1: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' */
+ /* expect+1: warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' [342] */
sink(((int)((_ctype_tab_ + 1)[((int)c)] & 0x0040)));
- /* expect+1: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' */
+ /* expect+1: warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342] */
sink(((int)((_ctype_tab_ + 1)[((unsigned int)c)] & 0x0040)));
}
Index: src/tests/usr.bin/xlint/lint1/msg_342.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_342.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_342.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_342.exp:1.3 Sun Jul 25 22:43:08 2021
+++ src/tests/usr.bin/xlint/lint1/msg_342.exp Fri Jun 17 18:54:53 2022
@@ -1,20 +1,20 @@
-msg_341.c(39): warning: argument to 'isalnum' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(41): warning: argument to 'isalpha' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(43): warning: argument to 'isblank' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(45): warning: argument to 'iscntrl' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(47): warning: argument to 'isdigit' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(49): warning: argument to 'isgraph' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(51): warning: argument to 'islower' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(53): warning: argument to 'isprint' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(55): warning: argument to 'ispunct' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(57): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(59): warning: argument to 'isupper' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(61): warning: argument to 'isxdigit' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(63): warning: argument to 'tolower' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(65): warning: argument to 'toupper' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(77): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(86): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'int' [342]
-msg_341.c(89): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' [342]
-msg_341.c(120): warning: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(126): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' [342]
-msg_341.c(129): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342]
+msg_342.c(39): warning: argument to 'isalnum' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(41): warning: argument to 'isalpha' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(43): warning: argument to 'isblank' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(45): warning: argument to 'iscntrl' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(47): warning: argument to 'isdigit' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(49): warning: argument to 'isgraph' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(51): warning: argument to 'islower' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(53): warning: argument to 'isprint' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(55): warning: argument to 'ispunct' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(57): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(59): warning: argument to 'isupper' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(61): warning: argument to 'isxdigit' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(63): warning: argument to 'tolower' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(65): warning: argument to 'toupper' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(77): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(86): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'int' [342]
+msg_342.c(89): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' [342]
+msg_342.c(120): warning: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' [341]
+msg_342.c(126): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' [342]
+msg_342.c(129): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342]
Index: src/tests/usr.bin/xlint/lint1/lex_integer.c
diff -u src/tests/usr.bin/xlint/lint1/lex_integer.c:1.9 src/tests/usr.bin/xlint/lint1/lex_integer.c:1.10
--- src/tests/usr.bin/xlint/lint1/lex_integer.c:1.9 Sat Aug 28 21:01:34 2021
+++ src/tests/usr.bin/xlint/lint1/lex_integer.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lex_integer.c,v 1.9 2021/08/28 21:01:34 rillig Exp $ */
+/* $NetBSD: lex_integer.c,v 1.10 2022/06/17 18:54:53 rillig Exp $ */
# 3 "lex_integer.c"
/*
@@ -24,104 +24,104 @@ void print_type(struct s);
void
no_suffix(void)
{
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
print_type(0);
/* The '-' is not part of the constant, it is a unary operator. */
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
print_type(-1);
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
print_type(2147483647);
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
print_type(0x7fffffff);
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
print_type(017777777777);
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(0x80000000);
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(020000000000);
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(0xffffffff);
- /* expect+1: passing 'long' */
+ /* expect+1: ... passing 'long' ... */
print_type(2147483648);
- /* expect+1: passing 'long' */
+ /* expect+1: ... passing 'long' ... */
print_type(0x0000000100000000);
- /* expect+1: passing 'long' */
+ /* expect+1: ... passing 'long' ... */
print_type(0x7fffffffffffffff);
- /* expect+1: passing 'unsigned long' */
+ /* expect+1: ... passing 'unsigned long' ... */
print_type(0x8000000000000000);
- /* expect+1: passing 'unsigned long' */
+ /* expect+1: ... passing 'unsigned long' ... */
print_type(0xffffffffffffffff);
/* expect+2: warning: integer constant out of range [252] */
- /* expect+1: warning: passing 'unsigned long' */
+ /* expect+1: ... passing 'unsigned long' ... */
print_type(0x00010000000000000000);
}
void
suffix_u(void)
{
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(3U);
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(3u);
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(4294967295U);
- /* expect+1: passing 'unsigned long' */
+ /* expect+1: ... passing 'unsigned long' ... */
print_type(4294967296U);
}
void
suffix_l(void)
{
- /* expect+1: passing 'long' */
+ /* expect+1: ... passing 'long' ... */
print_type(3L);
- /* expect+1: passing 'long' */
+ /* expect+1: ... passing 'long' ... */
print_type(3l);
}
void
suffix_ul(void)
{
- /* expect+1: passing 'unsigned long' */
+ /* expect+1: ... passing 'unsigned long' ... */
print_type(3UL);
- /* expect+1: passing 'unsigned long' */
+ /* expect+1: ... passing 'unsigned long' ... */
print_type(3LU);
}
void
suffix_ll(void)
{
- /* expect+1: passing 'long long' */
+ /* expect+1: ... passing 'long long' ... */
print_type(3LL);
/* The 'Ll' must not use mixed case. Checked by the compiler. */
- /* expect+1: passing 'long long' */
+ /* expect+1: ... passing 'long long' ... */
print_type(3Ll);
- /* expect+1: passing 'long long' */
+ /* expect+1: ... passing 'long long' ... */
print_type(3ll);
}
void
suffix_ull(void)
{
- /* expect+1: passing 'unsigned long long' */
+ /* expect+1: ... passing 'unsigned long long' ... */
print_type(3llu);
- /* expect+1: passing 'unsigned long long' */
+ /* expect+1: ... passing 'unsigned long long' ... */
print_type(3Ull);
/* The 'LL' must not be split. Checked by the compiler. */
- /* expect+1: passing 'unsigned long long' */
+ /* expect+1: ... passing 'unsigned long long' ... */
print_type(3lul);
/* The 'Ll' must not use mixed case. Checked by the compiler. */
- /* expect+1: passing 'unsigned long long' */
+ /* expect+1: ... passing 'unsigned long long' ... */
print_type(3ULl);
}
@@ -129,11 +129,11 @@ void
suffix_too_many(void)
{
/* expect+2: warning: malformed integer constant [251] */
- /* expect+1: passing 'long long' */
+ /* expect+1: ... passing 'long long' ... */
print_type(3LLL);
/* expect+2: warning: malformed integer constant [251] */
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(3uu);
}
@@ -142,9 +142,9 @@ void
binary_literal(void)
{
/* This is a GCC extension, but lint doesn't know that. */
- /* expect+1: passing 'int' */
+ /* expect+1: ... passing 'int' ... */
print_type(0b1111000001011010);
- /* expect+1: passing 'unsigned int' */
+ /* expect+1: ... passing 'unsigned int' ... */
print_type(0b11110000111100001111000011110000);
}
Index: src/tests/usr.bin/xlint/lint1/msg_031.c
diff -u src/tests/usr.bin/xlint/lint1/msg_031.c:1.7 src/tests/usr.bin/xlint/lint1/msg_031.c:1.8
--- src/tests/usr.bin/xlint/lint1/msg_031.c:1.7 Wed Jun 15 20:18:31 2022
+++ src/tests/usr.bin/xlint/lint1/msg_031.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_031.c,v 1.7 2022/06/15 20:18:31 rillig Exp $ */
+/* $NetBSD: msg_031.c,v 1.8 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_031.c"
// Test for message: '%s' has incomplete type '%s' [31]
@@ -13,9 +13,9 @@ struct incomplete;
struct complete complete_var;
-/* expect+1: 'incomplete_var' has incomplete type 'incomplete struct incomplete' */
+/* expect+1: error: 'incomplete_var' has incomplete type 'incomplete struct incomplete' [31] */
struct incomplete incomplete_var;
-/* expect+1: '<unnamed>' has incomplete type 'incomplete struct incomplete' [31] */
+/* expect+1: error: '<unnamed>' has incomplete type 'incomplete struct incomplete' [31] */
void function(struct incomplete);
Index: src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.7 src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.8
--- src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.7 Sat Apr 16 18:41:21 2022
+++ src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_259_ilp32.c,v 1.7 2022/04/16 18:41:21 rillig Exp $ */
+/* $NetBSD: msg_259_ilp32.c,v 1.8 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_259_ilp32.c"
/* Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] */
@@ -22,16 +22,16 @@ example(char c, int i, long l)
{
plain_char(c);
signed_int(c);
- /* expect+1: from 'char' to 'long' due to prototype [259] */
+ /* expect+1: ... from 'char' to 'long' due to prototype [259] */
signed_long(c);
plain_char(i);
signed_int(i);
- /* expect+1: from 'int' to 'long' due to prototype [259] */
+ /* expect+1: ... from 'int' to 'long' due to prototype [259] */
signed_long(i);
plain_char(l);
- /* expect+1: from 'long' to 'int' due to prototype [259] */
+ /* expect+1: ... from 'long' to 'int' due to prototype [259] */
signed_int(l);
signed_long(l);
}
Index: src/tests/usr.bin/xlint/lint1/msg_193.c
diff -u src/tests/usr.bin/xlint/lint1/msg_193.c:1.18 src/tests/usr.bin/xlint/lint1/msg_193.c:1.19
--- src/tests/usr.bin/xlint/lint1/msg_193.c:1.18 Thu Jun 16 16:58:36 2022
+++ src/tests/usr.bin/xlint/lint1/msg_193.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_193.c,v 1.18 2022/06/16 16:58:36 rillig Exp $ */
+/* $NetBSD: msg_193.c,v 1.19 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_193.c"
// Test for message: statement not reached [193]
@@ -52,7 +52,7 @@ test_if_statement(void)
reachable();
reachable();
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
reachable();
}
@@ -71,12 +71,12 @@ test_if_compound_statement(void)
}
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (0) {
{
{
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
}
}
@@ -90,7 +90,7 @@ test_if_without_else(void)
reachable();
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
reachable();
}
@@ -100,11 +100,11 @@ test_if_with_else(void)
if (1)
reachable();
else
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
reachable();
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
else
reachable();
reachable();
@@ -115,22 +115,22 @@ test_if_else_if_else(void)
{
if (1)
reachable();
- else if (1) /* expect+0: 193 */
+ else if (1) /* expect+0: ... [193] */
unreachable();
else
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
else if (1)
reachable();
else
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
else if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
else
reachable();
}
@@ -140,7 +140,7 @@ test_if_return(void)
{
if (1)
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -149,7 +149,7 @@ test_if_else_return(void)
if (1)
reachable();
else
- return; /* expect+0: 193 */
+ return; /* expect+0: ... [193] */
reachable();
}
@@ -158,7 +158,7 @@ test_for_forever(void)
{
for (;;)
reachable();
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -166,14 +166,14 @@ test_for_true(void)
{
for (; 1;)
reachable();
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
test_for_false(void)
{
for (; 0;)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
reachable();
}
@@ -183,7 +183,7 @@ test_for_break(void)
for (;;) {
reachable();
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
reachable();
}
@@ -194,16 +194,16 @@ test_for_if_break(void)
for (;;) {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
reachable();
}
@@ -214,9 +214,9 @@ test_for_continue(void)
for (;;) {
reachable();
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -225,18 +225,18 @@ test_for_if_continue(void)
for (;;) {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -245,9 +245,9 @@ test_for_return(void)
for (;;) {
reachable();
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -256,18 +256,18 @@ test_for_if_return(void)
for (;;) {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -275,14 +275,14 @@ test_while_true(void)
{
while (1)
reachable();
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
test_while_false(void)
{
while (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
reachable();
}
@@ -292,7 +292,7 @@ test_while_break(void)
while (1) {
reachable();
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
reachable();
}
@@ -303,16 +303,16 @@ test_while_if_break(void)
while (1) {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
reachable();
}
@@ -323,9 +323,9 @@ test_while_continue(void)
while (1) {
reachable();
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -334,18 +334,18 @@ test_while_if_continue(void)
while (1) {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -354,9 +354,9 @@ test_while_return(void)
while (1) {
reachable();
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -365,18 +365,18 @@ test_while_if_return(void)
while (1) {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -385,7 +385,7 @@ test_do_while_true(void)
do {
reachable();
} while (1);
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -403,7 +403,7 @@ test_do_while_break(void)
do {
reachable();
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
} while (1);
reachable();
}
@@ -414,16 +414,16 @@ test_do_while_if_break(void)
do {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
break;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
} while (1);
reachable();
}
@@ -434,9 +434,9 @@ test_do_while_continue(void)
do {
reachable();
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
} while (1);
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -445,18 +445,18 @@ test_do_while_if_continue(void)
do {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
continue;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
} while (1);
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -465,9 +465,9 @@ test_do_while_return(void)
do {
reachable();
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
} while (1);
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
@@ -476,31 +476,31 @@ test_do_while_if_return(void)
do {
reachable();
if (0) {
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
if (1) {
reachable();
return;
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
} while (1);
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
}
void
test_if_nested(void)
{
if (0) {
- if (1) /* expect+0: 193 */
+ if (1) /* expect+0: ... [193] */
unreachable();
else
- unreachable(); /* expect+0: 193 *//* XXX: redundant */
+ unreachable(); /* expect+0: ... [193] *//* XXX: redundant */
if (0)
- unreachable(); /* expect+0: 193 *//* XXX: redundant */
+ unreachable(); /* expect+0: ... [193] *//* XXX: redundant */
else
unreachable();
@@ -512,10 +512,10 @@ test_if_nested(void)
if (1)
reachable();
else
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
else
reachable();
@@ -529,7 +529,7 @@ test_if_maybe(void)
{
if (maybe()) {
if (0)
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
else
reachable();
reachable();
@@ -537,7 +537,7 @@ test_if_maybe(void)
reachable();
if (0) {
- if (maybe()) /* expect+0: 193 */
+ if (maybe()) /* expect+0: ... [193] */
unreachable();
else
unreachable();
@@ -595,7 +595,7 @@ test_while_goto(void)
goto out;
break; /* lint only warns with the -b option */
}
- unreachable(); /* expect+0: 193 */
+ unreachable(); /* expect+0: ... [193] */
out:
reachable();
}
@@ -604,7 +604,7 @@ void
test_unreachable_label(void)
{
if (0)
- goto unreachable; /* expect+0: 193 */
+ goto unreachable; /* expect+0: ... [193] */
goto reachable;
/* named_label assumes that any label is reachable. */
Index: src/tests/usr.bin/xlint/lint1/msg_259.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.20 src/tests/usr.bin/xlint/lint1/msg_259.c:1.21
--- src/tests/usr.bin/xlint/lint1/msg_259.c:1.20 Fri Apr 15 21:50:07 2022
+++ src/tests/usr.bin/xlint/lint1/msg_259.c Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_259.c,v 1.20 2022/04/15 21:50:07 rillig Exp $ */
+/* $NetBSD: msg_259.c,v 1.21 2022/06/17 18:54:53 rillig Exp $ */
# 3 "msg_259.c"
// Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259]
@@ -48,7 +48,7 @@ change_in_type_width(char c, int i, long
signed_long(i);
plain_char(l); /* XXX: why no warning? */
- /* expect+1: from 'long' to 'int' due to prototype [259] */
+ /* expect+1: ... from 'long' to 'int' due to prototype [259] */
signed_int(l);
signed_long(l);
}
Index: src/usr.bin/xlint/lint1/README.md
diff -u src/usr.bin/xlint/lint1/README.md:1.5 src/usr.bin/xlint/lint1/README.md:1.6
--- src/usr.bin/xlint/lint1/README.md:1.5 Wed Jun 15 18:11:02 2022
+++ src/usr.bin/xlint/lint1/README.md Fri Jun 17 18:54:53 2022
@@ -1,4 +1,4 @@
-[//]: # ($NetBSD: README.md,v 1.5 2022/06/15 18:11:02 rillig Exp $)
+[//]: # ($NetBSD: README.md,v 1.6 2022/06/17 18:54:53 rillig Exp $)
# Introduction
@@ -160,7 +160,9 @@ The comment `/* expect+1: ... */` expect
code 1 line below, `/* expect-5: ... */` expects a diagnostic to be generated
for the code 5 lines above.
Each `expect` comment must be in a single line.
-There may be other code or comments in the same line.
+At the start and the end of the comment, the placeholder `...` stands for an
+arbitrary sequence of characters.
+There may be other code or comments in the same line of the `.c` file.
Each diagnostic has its own test `msg_???.c` that triggers the corresponding
diagnostic.