Module Name: src
Committed By: rillig
Date: Sun Jan 31 11:12:07 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_000.c msg_001.c msg_002.c msg_003.c
msg_004.c msg_005.c msg_006.c msg_007.c msg_008.c msg_009.c
msg_027.c msg_029.c msg_031.c msg_034.c msg_035.c msg_036.c
msg_037.c msg_050.c msg_051.c msg_054.c msg_055.c msg_056.c
msg_057.c msg_060.c msg_061.c msg_066.c msg_068.c msg_071.c
msg_072.c msg_073.c msg_074.c msg_075.c msg_081.c msg_082.c
msg_083.c msg_084.c msg_086.c msg_087.c msg_088.c msg_089.c
msg_093.c msg_094.c msg_095.c msg_096.c msg_097.c msg_098.c
msg_099.c msg_100.c msg_101.c msg_108.c msg_109.c msg_114.c
msg_115.c msg_116.c msg_117.c msg_120.c msg_121.c msg_122.c
msg_125.c msg_126.c msg_127.c msg_127.exp msg_130.c msg_133.c
msg_136.c msg_142.c msg_143.c msg_144.c msg_145.c msg_146.c
msg_146.exp msg_150.c msg_156.c msg_160.c msg_164.c msg_165.c
msg_167.c msg_169.c msg_169.exp msg_170.c msg_172.c msg_173.c
msg_174.c msg_180.c msg_204.c msg_219.c msg_221.c msg_230.c
msg_232.c msg_265.c msg_308.c msg_324.c
Log Message:
lint: add expections to tests
msg_098: fix suffix for floating point constant
msg_127: remove prototype
msg_146: fix return type
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_000.c \
src/tests/usr.bin/xlint/lint1/msg_001.c \
src/tests/usr.bin/xlint/lint1/msg_002.c \
src/tests/usr.bin/xlint/lint1/msg_003.c \
src/tests/usr.bin/xlint/lint1/msg_004.c \
src/tests/usr.bin/xlint/lint1/msg_005.c \
src/tests/usr.bin/xlint/lint1/msg_006.c \
src/tests/usr.bin/xlint/lint1/msg_007.c \
src/tests/usr.bin/xlint/lint1/msg_008.c \
src/tests/usr.bin/xlint/lint1/msg_009.c \
src/tests/usr.bin/xlint/lint1/msg_027.c \
src/tests/usr.bin/xlint/lint1/msg_029.c \
src/tests/usr.bin/xlint/lint1/msg_031.c \
src/tests/usr.bin/xlint/lint1/msg_034.c \
src/tests/usr.bin/xlint/lint1/msg_036.c \
src/tests/usr.bin/xlint/lint1/msg_037.c \
src/tests/usr.bin/xlint/lint1/msg_050.c \
src/tests/usr.bin/xlint/lint1/msg_051.c \
src/tests/usr.bin/xlint/lint1/msg_054.c \
src/tests/usr.bin/xlint/lint1/msg_055.c \
src/tests/usr.bin/xlint/lint1/msg_056.c \
src/tests/usr.bin/xlint/lint1/msg_057.c \
src/tests/usr.bin/xlint/lint1/msg_060.c \
src/tests/usr.bin/xlint/lint1/msg_061.c \
src/tests/usr.bin/xlint/lint1/msg_066.c \
src/tests/usr.bin/xlint/lint1/msg_068.c \
src/tests/usr.bin/xlint/lint1/msg_071.c \
src/tests/usr.bin/xlint/lint1/msg_072.c \
src/tests/usr.bin/xlint/lint1/msg_073.c \
src/tests/usr.bin/xlint/lint1/msg_074.c \
src/tests/usr.bin/xlint/lint1/msg_075.c \
src/tests/usr.bin/xlint/lint1/msg_081.c \
src/tests/usr.bin/xlint/lint1/msg_082.c \
src/tests/usr.bin/xlint/lint1/msg_083.c \
src/tests/usr.bin/xlint/lint1/msg_084.c \
src/tests/usr.bin/xlint/lint1/msg_086.c \
src/tests/usr.bin/xlint/lint1/msg_087.c \
src/tests/usr.bin/xlint/lint1/msg_088.c \
src/tests/usr.bin/xlint/lint1/msg_089.c \
src/tests/usr.bin/xlint/lint1/msg_093.c \
src/tests/usr.bin/xlint/lint1/msg_094.c \
src/tests/usr.bin/xlint/lint1/msg_095.c \
src/tests/usr.bin/xlint/lint1/msg_096.c \
src/tests/usr.bin/xlint/lint1/msg_097.c \
src/tests/usr.bin/xlint/lint1/msg_098.c \
src/tests/usr.bin/xlint/lint1/msg_099.c \
src/tests/usr.bin/xlint/lint1/msg_100.c \
src/tests/usr.bin/xlint/lint1/msg_101.c \
src/tests/usr.bin/xlint/lint1/msg_109.c \
src/tests/usr.bin/xlint/lint1/msg_114.c \
src/tests/usr.bin/xlint/lint1/msg_117.c \
src/tests/usr.bin/xlint/lint1/msg_120.c \
src/tests/usr.bin/xlint/lint1/msg_121.c \
src/tests/usr.bin/xlint/lint1/msg_122.c \
src/tests/usr.bin/xlint/lint1/msg_125.c \
src/tests/usr.bin/xlint/lint1/msg_126.c \
src/tests/usr.bin/xlint/lint1/msg_127.c \
src/tests/usr.bin/xlint/lint1/msg_127.exp \
src/tests/usr.bin/xlint/lint1/msg_130.c \
src/tests/usr.bin/xlint/lint1/msg_133.c \
src/tests/usr.bin/xlint/lint1/msg_136.c \
src/tests/usr.bin/xlint/lint1/msg_142.c \
src/tests/usr.bin/xlint/lint1/msg_143.c \
src/tests/usr.bin/xlint/lint1/msg_144.c \
src/tests/usr.bin/xlint/lint1/msg_145.c \
src/tests/usr.bin/xlint/lint1/msg_146.c \
src/tests/usr.bin/xlint/lint1/msg_146.exp \
src/tests/usr.bin/xlint/lint1/msg_150.c \
src/tests/usr.bin/xlint/lint1/msg_156.c \
src/tests/usr.bin/xlint/lint1/msg_160.c \
src/tests/usr.bin/xlint/lint1/msg_164.c \
src/tests/usr.bin/xlint/lint1/msg_165.c \
src/tests/usr.bin/xlint/lint1/msg_167.c \
src/tests/usr.bin/xlint/lint1/msg_170.c \
src/tests/usr.bin/xlint/lint1/msg_172.c \
src/tests/usr.bin/xlint/lint1/msg_173.c \
src/tests/usr.bin/xlint/lint1/msg_174.c \
src/tests/usr.bin/xlint/lint1/msg_180.c \
src/tests/usr.bin/xlint/lint1/msg_219.c \
src/tests/usr.bin/xlint/lint1/msg_221.c \
src/tests/usr.bin/xlint/lint1/msg_230.c \
src/tests/usr.bin/xlint/lint1/msg_232.c \
src/tests/usr.bin/xlint/lint1/msg_265.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_035.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_108.c \
src/tests/usr.bin/xlint/lint1/msg_115.c \
src/tests/usr.bin/xlint/lint1/msg_116.c \
src/tests/usr.bin/xlint/lint1/msg_308.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_169.c \
src/tests/usr.bin/xlint/lint1/msg_169.exp \
src/tests/usr.bin/xlint/lint1/msg_204.c \
src/tests/usr.bin/xlint/lint1/msg_324.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/msg_000.c
diff -u src/tests/usr.bin/xlint/lint1/msg_000.c:1.2 src/tests/usr.bin/xlint/lint1/msg_000.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_000.c:1.2 Sat Jan 2 18:06:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_000.c Sun Jan 31 11:12:07 2021
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_000.c,v 1.2 2021/01/02 18:06:01 rillig Exp $ */
+/* $NetBSD: msg_000.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_000.c"
// Test for message: empty declaration [0]
extern int extern_declared;
-;
+; /* expect: 0 */
-static int local_defined;
+static int local_defined; /* expect: 226 */
Index: src/tests/usr.bin/xlint/lint1/msg_001.c
diff -u src/tests/usr.bin/xlint/lint1/msg_001.c:1.2 src/tests/usr.bin/xlint/lint1/msg_001.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_001.c:1.2 Sat Jan 2 18:06:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_001.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_001.c,v 1.2 2021/01/02 18:06:01 rillig Exp $ */
+/* $NetBSD: msg_001.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_001.c"
// Test for message: old style declaration; add int [1]
-old_style = 1;
+old_style = 1; /* expect: [1] */
int new_style = 1;
Index: src/tests/usr.bin/xlint/lint1/msg_002.c
diff -u src/tests/usr.bin/xlint/lint1/msg_002.c:1.2 src/tests/usr.bin/xlint/lint1/msg_002.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_002.c:1.2 Sat Jan 2 18:06:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_002.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_002.c,v 1.2 2021/01/02 18:06:01 rillig Exp $ */
+/* $NetBSD: msg_002.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_002.c"
// Test for message: empty declaration [2]
-int;
+int; /* expect: 2 */
int local_variable;
Index: src/tests/usr.bin/xlint/lint1/msg_003.c
diff -u src/tests/usr.bin/xlint/lint1/msg_003.c:1.2 src/tests/usr.bin/xlint/lint1/msg_003.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_003.c:1.2 Sun Jan 31 09:21:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_003.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_003.c,v 1.2 2021/01/31 09:21:24 rillig Exp $ */
+/* $NetBSD: msg_003.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_003.c"
// Test for message: %s declared in argument declaration list [3]
@@ -6,8 +6,8 @@
/*ARGSUSED*/
void
example(declare_struct, declare_union, declare_enum)
- struct struct_in_argument *declare_struct;
- union union_in_argument *declare_union;
- enum enum_in_argument *declare_enum;
+ struct struct_in_argument *declare_struct; /* expect: 3 */
+ union union_in_argument *declare_union; /* expect: 3 */
+ enum enum_in_argument *declare_enum; /* expect: 3 */
{
}
Index: src/tests/usr.bin/xlint/lint1/msg_004.c
diff -u src/tests/usr.bin/xlint/lint1/msg_004.c:1.2 src/tests/usr.bin/xlint/lint1/msg_004.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_004.c:1.2 Sat Jan 2 18:06:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_004.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_004.c,v 1.2 2021/01/02 18:06:01 rillig Exp $ */
+/* $NetBSD: msg_004.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_004.c"
// Test for message: illegal type combination [4]
@@ -10,12 +10,12 @@ int ok_int;
double ok_double;
float _Complex ok_float_complex;
-int _Complex illegal_int_complex;
+int _Complex illegal_int_complex; /* expect: 4, 308 */
char enum {
CHAR
-};
+}; /* expect: 4 */
long struct {
int member;
-};
+}; /* expect: 4 */
Index: src/tests/usr.bin/xlint/lint1/msg_005.c
diff -u src/tests/usr.bin/xlint/lint1/msg_005.c:1.2 src/tests/usr.bin/xlint/lint1/msg_005.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_005.c:1.2 Sat Jan 2 18:06:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_005.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_005.c,v 1.2 2021/01/02 18:06:01 rillig Exp $ */
+/* $NetBSD: msg_005.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_005.c"
// Test for message: modifying typedef with '%s'; only qualifiers allowed [5]
typedef int number;
-number long long_variable;
+number long long_variable; /* expect: 5 */
number const const_variable;
Index: src/tests/usr.bin/xlint/lint1/msg_006.c
diff -u src/tests/usr.bin/xlint/lint1/msg_006.c:1.2 src/tests/usr.bin/xlint/lint1/msg_006.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_006.c:1.2 Thu Jan 7 18:37:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_006.c Sun Jan 31 11:12:07 2021
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_006.c,v 1.2 2021/01/07 18:37:41 rillig Exp $ */
+/* $NetBSD: msg_006.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_006.c"
// Test for message: use 'double' instead of 'long float' [6]
-long float x;
+long float x; /* expect: 6, 4 */
double x;
Index: src/tests/usr.bin/xlint/lint1/msg_007.c
diff -u src/tests/usr.bin/xlint/lint1/msg_007.c:1.2 src/tests/usr.bin/xlint/lint1/msg_007.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_007.c:1.2 Thu Jan 7 18:37:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_007.c Sun Jan 31 11:12:07 2021
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_007.c,v 1.2 2021/01/07 18:37:41 rillig Exp $ */
+/* $NetBSD: msg_007.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_007.c"
// Test for message: only one storage class allowed [7]
-extern static void example(void);
+extern static void example(void); /* expect: 7 */
extern extern_function(void);
Index: src/tests/usr.bin/xlint/lint1/msg_008.c
diff -u src/tests/usr.bin/xlint/lint1/msg_008.c:1.2 src/tests/usr.bin/xlint/lint1/msg_008.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_008.c:1.2 Thu Jan 7 18:37:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_008.c Sun Jan 31 11:12:07 2021
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_008.c,v 1.2 2021/01/07 18:37:41 rillig Exp $ */
+/* $NetBSD: msg_008.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_008.c"
// Test for message: illegal storage class [8]
typedef void
example(void)
-{
+{ /* expect: 8 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_009.c
diff -u src/tests/usr.bin/xlint/lint1/msg_009.c:1.2 src/tests/usr.bin/xlint/lint1/msg_009.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_009.c:1.2 Thu Jan 7 18:37:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_009.c Sun Jan 31 11:12:07 2021
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_009.c,v 1.2 2021/01/07 18:37:41 rillig Exp $ */
+/* $NetBSD: msg_009.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_009.c"
// Test for message: only register valid as formal parameter storage class [9]
-extern void typedef_example(typedef int param);
-extern void auto_example(auto int param);
-extern void static_example(static int param);
-extern void extern_example(extern int param);
+extern void typedef_example(typedef int param); /* expect: 9 */
+extern void auto_example(auto int param); /* expect: 9 */
+extern void static_example(static int param); /* expect: 9 */
+extern void extern_example(extern int param); /* expect: 9 */
Index: src/tests/usr.bin/xlint/lint1/msg_027.c
diff -u src/tests/usr.bin/xlint/lint1/msg_027.c:1.2 src/tests/usr.bin/xlint/lint1/msg_027.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_027.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_027.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_027.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_027.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_027.c"
// Test for message: redeclaration of %s [27]
extern int identifier(void);
-extern double identifier(void);
+extern double identifier(void); /* expect: 27 */
Index: src/tests/usr.bin/xlint/lint1/msg_029.c
diff -u src/tests/usr.bin/xlint/lint1/msg_029.c:1.2 src/tests/usr.bin/xlint/lint1/msg_029.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_029.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_029.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_029.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_029.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_029.c"
// Test for message: previously declared extern, becomes static: %s [29]
@@ -6,6 +6,6 @@
extern int function(void);
static int function(void)
-{
+{ /* expect: 29 */
return function();
}
Index: src/tests/usr.bin/xlint/lint1/msg_031.c
diff -u src/tests/usr.bin/xlint/lint1/msg_031.c:1.2 src/tests/usr.bin/xlint/lint1/msg_031.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_031.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_031.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_031.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_031.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_031.c"
// Test for message: incomplete structure or union %s: %s [31]
@@ -7,9 +7,9 @@ struct complete {
int dummy;
};
-struct incomplete;
+struct incomplete; /* expect: 233 */
struct complete complete_var;
-struct incomplete incomplete_var;
+struct incomplete incomplete_var; /* expect: 31 */
Index: src/tests/usr.bin/xlint/lint1/msg_034.c
diff -u src/tests/usr.bin/xlint/lint1/msg_034.c:1.2 src/tests/usr.bin/xlint/lint1/msg_034.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_034.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_034.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_034.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_034.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_034.c"
// Test for message: nonportable bit-field type [34]
@@ -6,6 +6,6 @@
/* lint1-flags: -S -g -p -w */
struct example {
- int nonportable: 1;
+ int nonportable: 1; /* expect: 34 */
unsigned int portable: 1;
};
Index: src/tests/usr.bin/xlint/lint1/msg_036.c
diff -u src/tests/usr.bin/xlint/lint1/msg_036.c:1.2 src/tests/usr.bin/xlint/lint1/msg_036.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_036.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_036.c Sun Jan 31 11:12:07 2021
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_036.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_036.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_036.c"
// Test for message: illegal bit-field size: %d [36]
struct example {
- unsigned int too_large: 100000;
- unsigned int negative: -1;
+ unsigned int too_large: 100000; /* expect: 36 */
+ unsigned int negative: -1; /* expect: 36 */
unsigned int ok: 3;
};
Index: src/tests/usr.bin/xlint/lint1/msg_037.c
diff -u src/tests/usr.bin/xlint/lint1/msg_037.c:1.2 src/tests/usr.bin/xlint/lint1/msg_037.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_037.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_037.c Sun Jan 31 11:12:07 2021
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_037.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_037.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_037.c"
// Test for message: zero size bit-field [37]
struct example {
- unsigned int zero: 0;
+ unsigned int zero: 0; /* expect: 37 */
unsigned int ok: 3;
};
Index: src/tests/usr.bin/xlint/lint1/msg_050.c
diff -u src/tests/usr.bin/xlint/lint1/msg_050.c:1.2 src/tests/usr.bin/xlint/lint1/msg_050.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_050.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_050.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_050.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_050.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_050.c"
/* Test for message: a function is declared as an argument: %s [50] */
@@ -7,7 +7,7 @@
typedef void (function)();
-void example(f)
- function f;
+void example(f) /* expect: 231 */
+ function f; /* expect: 50 */
{
}
Index: src/tests/usr.bin/xlint/lint1/msg_051.c
diff -u src/tests/usr.bin/xlint/lint1/msg_051.c:1.2 src/tests/usr.bin/xlint/lint1/msg_051.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_051.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_051.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_051.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_051.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_051.c"
// Test for message: parameter mismatch: %d declared, %d defined [51]
@@ -7,7 +7,7 @@ void
example(int, int);
void
-example(a, b, c)
+example(a, b, c) /* expect: 231, 231, 231 */
int a, b, c;
-{
+{ /* expect: 51 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_054.c
diff -u src/tests/usr.bin/xlint/lint1/msg_054.c:1.2 src/tests/usr.bin/xlint/lint1/msg_054.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_054.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_054.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_054.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_054.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_054.c"
/* Test for message: trailing ',' prohibited in enum declaration [54] */
@@ -9,4 +9,4 @@ enum color {
RED,
GREEN,
BLUE,
-};
+}; /* expect: 54 */
Index: src/tests/usr.bin/xlint/lint1/msg_055.c
diff -u src/tests/usr.bin/xlint/lint1/msg_055.c:1.2 src/tests/usr.bin/xlint/lint1/msg_055.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_055.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_055.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_055.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_055.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_055.c"
// Test for message: integral constant expression expected [55]
enum color {
WHITE = 1.0
-};
+}; /* expect: 55 */
Index: src/tests/usr.bin/xlint/lint1/msg_056.c
diff -u src/tests/usr.bin/xlint/lint1/msg_056.c:1.2 src/tests/usr.bin/xlint/lint1/msg_056.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_056.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_056.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_056.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_056.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_056.c"
// Test for message: integral constant too large [56]
enum color {
- WHITE = 0xFFFFFFFFFFFFFFFFFFFF
-};
+ WHITE = 0xFFFFFFFFFFFFFFFFFFFF /* expect: 252 */
+}; /* expect: 56 */
Index: src/tests/usr.bin/xlint/lint1/msg_057.c
diff -u src/tests/usr.bin/xlint/lint1/msg_057.c:1.2 src/tests/usr.bin/xlint/lint1/msg_057.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_057.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_057.c Sun Jan 31 11:12:07 2021
@@ -1,14 +1,14 @@
-/* $NetBSD: msg_057.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_057.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_057.c"
// Test for message: enumeration constant hides parameter: %s [57]
long
-rgb(int red, int green, int blue)
+rgb(int red, int green, int blue) /* expect: 231, 231, 231 */
{
enum color {
- red, green, blue
- };
+ red, green, blue /* expect: 57, 57 */
+ }; /* expect: 57 */
return red + green + blue;
}
Index: src/tests/usr.bin/xlint/lint1/msg_060.c
diff -u src/tests/usr.bin/xlint/lint1/msg_060.c:1.2 src/tests/usr.bin/xlint/lint1/msg_060.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_060.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_060.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_060.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_060.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_060.c"
// Test for message: void must be sole parameter [60]
void example_1(void);
-void example_2(int, void);
-void example_3(void, void, void);
+void example_2(int, void); /* expect: 60 */
+void example_3(void, void, void); /* expect: 60, 60, 60 */
Index: src/tests/usr.bin/xlint/lint1/msg_061.c
diff -u src/tests/usr.bin/xlint/lint1/msg_061.c:1.2 src/tests/usr.bin/xlint/lint1/msg_061.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_061.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_061.c Sun Jan 31 11:12:07 2021
@@ -1,6 +1,6 @@
-/* $NetBSD: msg_061.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_061.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_061.c"
// Test for message: void parameter cannot have name: %s [61]
-void example(void arg);
+void example(void arg); /* expect: 61 */
Index: src/tests/usr.bin/xlint/lint1/msg_066.c
diff -u src/tests/usr.bin/xlint/lint1/msg_066.c:1.2 src/tests/usr.bin/xlint/lint1/msg_066.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_066.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_066.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_066.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_066.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_066.c"
// Test for message: syntax requires ';' after last struct/union member [66]
struct number {
int value
-};
+}; /* expect: 66 */
Index: src/tests/usr.bin/xlint/lint1/msg_068.c
diff -u src/tests/usr.bin/xlint/lint1/msg_068.c:1.2 src/tests/usr.bin/xlint/lint1/msg_068.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_068.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_068.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_068.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_068.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_068.c"
// Test for message: typedef already qualified with '%s' [68]
typedef const char const_char;
-const const_char twice_const;
+const const_char twice_const; /* expect: 68 */
Index: src/tests/usr.bin/xlint/lint1/msg_071.c
diff -u src/tests/usr.bin/xlint/lint1/msg_071.c:1.2 src/tests/usr.bin/xlint/lint1/msg_071.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_071.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_071.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_071.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_071.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_071.c"
// Test for message: too many characters in character constant [71]
@@ -8,4 +8,4 @@
* sequence of characters that can constitute the escape sequence.
*/
char valid_multi_digit_hex = '\x0000000000000000000000a';
-char invalid_multi_digit_hex = '\x000g000000000000000000a';
+char invalid_multi_digit_hex = '\x000g000000000000000000a'; /* expect: 71, 178 */
Index: src/tests/usr.bin/xlint/lint1/msg_072.c
diff -u src/tests/usr.bin/xlint/lint1/msg_072.c:1.2 src/tests/usr.bin/xlint/lint1/msg_072.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_072.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_072.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_072.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_072.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_072.c"
// Test for message: typedef declares no type name [72]
-typedef int;
+typedef int; /* expect: 72 */
typedef int number;
Index: src/tests/usr.bin/xlint/lint1/msg_073.c
diff -u src/tests/usr.bin/xlint/lint1/msg_073.c:1.2 src/tests/usr.bin/xlint/lint1/msg_073.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_073.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_073.c Sun Jan 31 11:12:07 2021
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_073.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_073.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_073.c"
// Test for message: empty character constant [73]
-char empty = '';
+char empty = ''; /* expect: 73 */
char letter = 'x';
Index: src/tests/usr.bin/xlint/lint1/msg_074.c
diff -u src/tests/usr.bin/xlint/lint1/msg_074.c:1.2 src/tests/usr.bin/xlint/lint1/msg_074.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_074.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_074.c Sun Jan 31 11:12:07 2021
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_074.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_074.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_074.c"
// Test for message: no hex digits follow \x [74]
-char invalid_hex = '\x';
-char invalid_hex_letter = '\xg';
+char invalid_hex = '\x'; /* expect: 74 */
+char invalid_hex_letter = '\xg'; /* expect: 74, 294 */
char valid_hex = '\xff';
char valid_single_digit_hex = '\xa';
Index: src/tests/usr.bin/xlint/lint1/msg_075.c
diff -u src/tests/usr.bin/xlint/lint1/msg_075.c:1.2 src/tests/usr.bin/xlint/lint1/msg_075.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_075.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_075.c Sun Jan 31 11:12:07 2021
@@ -1,6 +1,6 @@
-/* $NetBSD: msg_075.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_075.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_075.c"
// Test for message: overflow in hex escape [75]
-char str[] = "\x12345678123456781234567812345678";
+char str[] = "\x12345678123456781234567812345678"; /* expect: 75 */
Index: src/tests/usr.bin/xlint/lint1/msg_081.c
diff -u src/tests/usr.bin/xlint/lint1/msg_081.c:1.2 src/tests/usr.bin/xlint/lint1/msg_081.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_081.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_081.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_081.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_081.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_081.c"
// Test for message: \a undefined in traditional C [81]
/* lint1-flags: -Stw */
-char str[] = "The bell\a rings";
+char str[] = "The bell\a rings"; /* expect: 81 */
Index: src/tests/usr.bin/xlint/lint1/msg_082.c
diff -u src/tests/usr.bin/xlint/lint1/msg_082.c:1.2 src/tests/usr.bin/xlint/lint1/msg_082.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_082.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_082.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_082.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_082.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_082.c"
/* Test for message: \x undefined in traditional C [82] */
/* lint1-flags: -Stw */
-char str[] = "A he\x78 escape";
+char str[] = "A he\x78 escape"; /* expect: 82 */
Index: src/tests/usr.bin/xlint/lint1/msg_083.c
diff -u src/tests/usr.bin/xlint/lint1/msg_083.c:1.2 src/tests/usr.bin/xlint/lint1/msg_083.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_083.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_083.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_083.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_083.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_083.c"
// Test for message: storage class after type is obsolescent [83]
@@ -6,5 +6,5 @@
void
example(void)
{
- int register x;
+ int register x; /* expect: 83 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_084.c
diff -u src/tests/usr.bin/xlint/lint1/msg_084.c:1.2 src/tests/usr.bin/xlint/lint1/msg_084.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_084.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_084.c Sun Jan 31 11:12:07 2021
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_084.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_084.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_084.c"
// Test for message: ANSI C requires formal parameter before '...' [84]
-void only_ellipsis(...)
+void only_ellipsis(...) /* expect: 84 */
{
}
-void ok_ellipsis(const char *fmt, ...)
+void ok_ellipsis(const char *fmt, ...) /* expect: 231 */
{
}
Index: src/tests/usr.bin/xlint/lint1/msg_086.c
diff -u src/tests/usr.bin/xlint/lint1/msg_086.c:1.2 src/tests/usr.bin/xlint/lint1/msg_086.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_086.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_086.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_086.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_086.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_086.c"
// Test for message: automatic hides external declaration: %s [86]
@@ -10,7 +10,7 @@ extern int identifier;
int
local_auto(void)
{
- int identifier = 3;
+ int identifier = 3; /* expect: 86 */
return identifier;
}
Index: src/tests/usr.bin/xlint/lint1/msg_087.c
diff -u src/tests/usr.bin/xlint/lint1/msg_087.c:1.2 src/tests/usr.bin/xlint/lint1/msg_087.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_087.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_087.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_087.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_087.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_087.c"
// Test for message: static hides external declaration: %s [87]
@@ -10,6 +10,6 @@ extern int counter;
int
count(void)
{
- static int counter;
+ static int counter; /* expect: 87 */
return counter++;
}
Index: src/tests/usr.bin/xlint/lint1/msg_088.c
diff -u src/tests/usr.bin/xlint/lint1/msg_088.c:1.2 src/tests/usr.bin/xlint/lint1/msg_088.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_088.c:1.2 Sun Jan 3 15:35:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_088.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_088.c,v 1.2 2021/01/03 15:35:00 rillig Exp $ */
+/* $NetBSD: msg_088.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_088.c"
// Test for message: typedef hides external declaration: %s [88]
@@ -10,5 +10,5 @@ extern int identifier;
void
func(void)
{
- typedef double identifier;
+ typedef double identifier; /* expect: 88 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_089.c
diff -u src/tests/usr.bin/xlint/lint1/msg_089.c:1.2 src/tests/usr.bin/xlint/lint1/msg_089.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_089.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_089.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_089.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_089.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_089.c"
// Test for message: typedef redeclared: %s [89]
typedef int number;
-typedef int number;
-typedef double number;
+typedef int number; /* expect: 89 */
+typedef double number; /* expect: 89 */
Index: src/tests/usr.bin/xlint/lint1/msg_093.c
diff -u src/tests/usr.bin/xlint/lint1/msg_093.c:1.2 src/tests/usr.bin/xlint/lint1/msg_093.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_093.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_093.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_093.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_093.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_093.c"
// Test for message: dubious static function at block level: %s [93]
@@ -6,7 +6,7 @@
void
example(void)
{
- static void nested(void);
+ static void nested(void); /* expect: 93 */
nested();
}
Index: src/tests/usr.bin/xlint/lint1/msg_094.c
diff -u src/tests/usr.bin/xlint/lint1/msg_094.c:1.2 src/tests/usr.bin/xlint/lint1/msg_094.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_094.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_094.c Sun Jan 31 11:12:07 2021
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_094.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_094.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_094.c"
// Test for message: function has illegal storage class: %s [94]
register int
-global_example(int arg)
+global_example(int arg) /* expect: 8 */
{
- register int register_example(int);
+ register int register_example(int); /* expect: 94 */
return arg;
}
Index: src/tests/usr.bin/xlint/lint1/msg_095.c
diff -u src/tests/usr.bin/xlint/lint1/msg_095.c:1.2 src/tests/usr.bin/xlint/lint1/msg_095.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_095.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_095.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_095.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_095.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_095.c"
// Test for message: declaration hides earlier one: %s [95]
@@ -12,7 +12,7 @@ example(int identifier)
{
{
- int identifier = 3;
+ int identifier = 3; /* expect: 95 */
}
return identifier;
Index: src/tests/usr.bin/xlint/lint1/msg_096.c
diff -u src/tests/usr.bin/xlint/lint1/msg_096.c:1.2 src/tests/usr.bin/xlint/lint1/msg_096.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_096.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_096.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_096.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_096.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_096.c"
// Test for message: cannot dereference non-pointer type [96]
@@ -16,7 +16,7 @@ unary_minus(int i)
}
int
-unary_asterisk(int i)
+unary_asterisk(int i) /* expect: 231 */
{
- return *i;
+ return *i; /* expect: 96, 214 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_097.c
diff -u src/tests/usr.bin/xlint/lint1/msg_097.c:1.2 src/tests/usr.bin/xlint/lint1/msg_097.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_097.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_097.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_097.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_097.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_097.c"
/* Test for message: suffix U is illegal in traditional C [97] */
@@ -10,12 +10,12 @@ example()
{
int i = 1234567;
unsigned u = 1234567;
- unsigned u_upper = 1234567U;
- unsigned u_lower = 1234567u;
+ unsigned u_upper = 1234567U; /* expect: 97 */
+ unsigned u_lower = 1234567u; /* expect: 97 */
long l = 1234567L;
- unsigned long ul = 1234567UL;
+ unsigned long ul = 1234567UL; /* expect: 97 */
long long ll = 1234567LL;
- unsigned long long ull = 1234567ULL;
+ unsigned long long ull = 1234567ULL; /* expect: 97 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_098.c
diff -u src/tests/usr.bin/xlint/lint1/msg_098.c:1.2 src/tests/usr.bin/xlint/lint1/msg_098.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_098.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_098.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_098.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_098.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_098.c"
/* Test for message: suffixes F and L are illegal in traditional C [98] */
@@ -9,12 +9,12 @@ void
example()
{
float f = 1234.5;
- float f_F = 1234.5F;
- float f_f = 1234.5F;
+ float f_F = 1234.5F; /* expect: 98 */
+ float f_f = 1234.5f; /* expect: 98 */
double d = 1234.5;
- double d_U = 1234.5U;
+ double d_U = 1234.5U; /* expect: 249 */
- long double ld = 1234.5;
- long double ld_L = 1234.5L;
+ long double ld = 1234.5; /* expect: 266 */
+ long double ld_L = 1234.5L; /* expect: 98, 266 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_099.c
diff -u src/tests/usr.bin/xlint/lint1/msg_099.c:1.2 src/tests/usr.bin/xlint/lint1/msg_099.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_099.c:1.2 Thu Jan 7 00:38:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_099.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_099.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
+/* $NetBSD: msg_099.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_099.c"
// Test for message: %s undefined [99]
@@ -7,5 +7,5 @@ void
example(int defined_variable)
{
int ok = defined_variable;
- int error = undefined_variable;
+ int error = undefined_variable; /* expect: 99 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_100.c
diff -u src/tests/usr.bin/xlint/lint1/msg_100.c:1.2 src/tests/usr.bin/xlint/lint1/msg_100.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_100.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_100.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_100.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_100.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_100.c"
// Test for message: unary + is illegal in traditional C [100]
@@ -7,6 +7,6 @@
int
unary_plus(int x)
-{
- return +x;
+{ /* expect: 270 */
+ return +x; /* expect: 100 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_101.c
diff -u src/tests/usr.bin/xlint/lint1/msg_101.c:1.2 src/tests/usr.bin/xlint/lint1/msg_101.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_101.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_101.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_101.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_101.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_101.c"
// Test for message: undefined struct/union member: %s [101]
@@ -10,5 +10,5 @@ struct point {
int
get_z(const struct point *p)
{
- return p.z;
+ return p.z; /* expect: 101 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_109.c
diff -u src/tests/usr.bin/xlint/lint1/msg_109.c:1.2 src/tests/usr.bin/xlint/lint1/msg_109.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_109.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_109.c Sun Jan 31 11:12:07 2021
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_109.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_109.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_109.c"
// Test for message: void type illegal in expression [109]
int
-example(int arg)
+example(int arg) /* expect: 231 */
{
- return arg + (void)4;
+ return arg + (void)4; /* expect: 109, 214 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_114.c
diff -u src/tests/usr.bin/xlint/lint1/msg_114.c:1.2 src/tests/usr.bin/xlint/lint1/msg_114.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_114.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_114.c Sun Jan 31 11:12:07 2021
@@ -1,13 +1,13 @@
-/* $NetBSD: msg_114.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_114.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_114.c"
// Test for message: %soperand of '%s' must be lvalue [114]
void
-example(int a)
+example(int a) /* expect: 231 */
{
- 3++;
+ 3++; /* expect: 114 */
// FIXME: lint error: ../common/tyname.c, 190: tspec_name(0)
// "string"++;
- (a + a)++;
+ (a + a)++; /* expect: 114 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_117.c
diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.2 src/tests/usr.bin/xlint/lint1/msg_117.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_117.c:1.2 Sat Jan 9 14:37:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_117.c,v 1.2 2021/01/09 14:37:16 rillig Exp $ */
+/* $NetBSD: msg_117.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_117.c"
// Test for message: bitwise operation on signed value possibly nonportable [117]
@@ -8,7 +8,7 @@
int
shr(int a, int b)
{
- return a >> b;
+ return a >> b; /* expect: 117 */
}
int
@@ -20,17 +20,17 @@ shr_lhs_constant_positive(int a)
int
shr_lhs_constant_negative(int a)
{
- return -0x1234 >> a;
+ return -0x1234 >> a; /* expect: 120 */
}
int
shr_rhs_constant_positive(int a)
{
- return a >> 0x1234;
+ return a >> 0x1234; /* expect: 117, 122 */
}
int
shr_rhs_constant_negative(int a)
{
- return a >> -0x1234;
+ return a >> -0x1234; /* expect: 117, 121 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_120.c
diff -u src/tests/usr.bin/xlint/lint1/msg_120.c:1.2 src/tests/usr.bin/xlint/lint1/msg_120.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_120.c:1.2 Sat Jan 9 14:37:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_120.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_120.c,v 1.2 2021/01/09 14:37:16 rillig Exp $ */
+/* $NetBSD: msg_120.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_120.c"
// Test for message: bitwise operation on signed value nonportable [120]
@@ -8,7 +8,7 @@
int
shr(int a, int b)
{
- return a >> b;
+ return a >> b; /* expect: 117 */
}
int
@@ -20,17 +20,17 @@ shr_lhs_constant_positive(int a)
int
shr_lhs_constant_negative(int a)
{
- return -0x1234 >> a;
+ return -0x1234 >> a; /* expect: 120 */
}
int
shr_rhs_constant_positive(int a)
{
- return a >> 0x1234;
+ return a >> 0x1234; /* expect: 117, 122 */
}
int
shr_rhs_constant_negative(int a)
{
- return a >> -0x1234;
+ return a >> -0x1234; /* expect: 117, 121 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_121.c
diff -u src/tests/usr.bin/xlint/lint1/msg_121.c:1.2 src/tests/usr.bin/xlint/lint1/msg_121.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_121.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_121.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_121.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_121.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_121.c"
// Test for message: negative shift [121]
@@ -6,5 +6,5 @@
int
example(int x)
{
- return x << (3 - 5);
+ return x << (3 - 5); /* expect: 121 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_122.c
diff -u src/tests/usr.bin/xlint/lint1/msg_122.c:1.2 src/tests/usr.bin/xlint/lint1/msg_122.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_122.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_122.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_122.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_122.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_122.c"
// Test for message: shift greater than size of object [122]
@@ -6,5 +6,5 @@
int
example(int x)
{
- return x << 129;
+ return x << 129; /* expect: 122 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_125.c
diff -u src/tests/usr.bin/xlint/lint1/msg_125.c:1.2 src/tests/usr.bin/xlint/lint1/msg_125.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_125.c:1.2 Sat Jan 9 14:37:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_125.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_125.c,v 1.2 2021/01/09 14:37:16 rillig Exp $ */
+/* $NetBSD: msg_125.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_125.c"
// Test for message: ANSI C forbids ordered comparisons of pointers to functions [125]
@@ -10,5 +10,5 @@ typedef void (*action)(void);
int
less(action a, action b)
{
- return a < b;
+ return a < b; /* expect: 125 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_126.c
diff -u src/tests/usr.bin/xlint/lint1/msg_126.c:1.2 src/tests/usr.bin/xlint/lint1/msg_126.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_126.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_126.c Sun Jan 31 11:12:07 2021
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_126.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_126.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_126.c"
// Test for message: incompatible types in conditional [126]
int
-max(int cond, void *ptr, double dbl)
+max(int cond, void *ptr, double dbl) /* expect: 231, 231, 231 */
{
- return cond ? ptr : dbl;
+ return cond ? ptr : dbl; /* expect: 126, 214 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_127.c
diff -u src/tests/usr.bin/xlint/lint1/msg_127.c:1.2 src/tests/usr.bin/xlint/lint1/msg_127.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_127.c:1.2 Sat Jan 9 14:37:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_127.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_127.c,v 1.2 2021/01/09 14:37:16 rillig Exp $ */
+/* $NetBSD: msg_127.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_127.c"
/* Test for message: '&' before array or function: ignored [127] */
@@ -6,8 +6,8 @@
/* lint1-extra-flags: -t */
void
-example(void)
+example()
{
- if (&example != (void *)0)
+ if (&example != (void *)0) /* expect: 127 */
return;
}
Index: src/tests/usr.bin/xlint/lint1/msg_127.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_127.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_127.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_127.exp:1.2 Sat Jan 9 14:37:16 2021
+++ src/tests/usr.bin/xlint/lint1/msg_127.exp Sun Jan 31 11:12:07 2021
@@ -5,5 +5,4 @@
(3): warning: 'long double' is illegal in traditional C [266]
(3): warning: 'long double' is illegal in traditional C [266]
(3): warning: function prototypes are illegal in traditional C [270]
-msg_127.c(10): warning: function prototypes are illegal in traditional C [270]
msg_127.c(11): warning: '&' before array or function: ignored [127]
Index: src/tests/usr.bin/xlint/lint1/msg_130.c
diff -u src/tests/usr.bin/xlint/lint1/msg_130.c:1.2 src/tests/usr.bin/xlint/lint1/msg_130.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_130.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_130.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_130.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_130.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_130.c"
// Test for message: enum type mismatch, op %s [130]
@@ -14,5 +14,5 @@ enum daytime {
int
example(_Bool cond)
{
- return cond ? GREEN : MORNING;
+ return cond ? GREEN : MORNING; /* expect: 130 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_133.c
diff -u src/tests/usr.bin/xlint/lint1/msg_133.c:1.2 src/tests/usr.bin/xlint/lint1/msg_133.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_133.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_133.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_133.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_133.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_133.c"
// Test for message: conversion of pointer to '%s' loses bits [133]
@@ -6,5 +6,5 @@
char
to_char(void *ptr)
{
- return (char)ptr;
+ return (char)ptr; /* expect: 133 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_136.c
diff -u src/tests/usr.bin/xlint/lint1/msg_136.c:1.2 src/tests/usr.bin/xlint/lint1/msg_136.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_136.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_136.c Sun Jan 31 11:12:07 2021
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_136.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_136.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_136.c"
// Test for message: cannot do pointer arithmetic on operand of unknown size [136]
-struct incomplete;
+struct incomplete; /* expect: 233 */
const struct incomplete *
example(const struct incomplete *ptr)
{
- return ptr + 5;
+ return ptr + 5; /* expect: 136 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_142.c
diff -u src/tests/usr.bin/xlint/lint1/msg_142.c:1.2 src/tests/usr.bin/xlint/lint1/msg_142.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_142.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_142.c Sun Jan 31 11:12:07 2021
@@ -1,6 +1,6 @@
-/* $NetBSD: msg_142.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_142.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_142.c"
// Test for message: floating point overflow detected, op %s [142]
-double dbl = 1e100 * 1e100 * 1e100 * 1e100 * 1e100;
+double dbl = 1e100 * 1e100 * 1e100 * 1e100 * 1e100; /* expect: 142, 142 */
Index: src/tests/usr.bin/xlint/lint1/msg_143.c
diff -u src/tests/usr.bin/xlint/lint1/msg_143.c:1.2 src/tests/usr.bin/xlint/lint1/msg_143.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_143.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_143.c Sun Jan 31 11:12:07 2021
@@ -1,12 +1,12 @@
-/* $NetBSD: msg_143.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_143.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_143.c"
// Test for message: cannot take size/alignment of incomplete type [143]
-struct incomplete;
+struct incomplete; /* expect: 233 */
unsigned long
sizeof_incomplete(void)
{
- return sizeof(struct incomplete);
+ return sizeof(struct incomplete); /* expect: 143 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_144.c
diff -u src/tests/usr.bin/xlint/lint1/msg_144.c:1.2 src/tests/usr.bin/xlint/lint1/msg_144.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_144.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_144.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_144.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_144.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_144.c"
// Test for message: cannot take size/alignment of function [144]
@@ -6,5 +6,5 @@
unsigned long
example(void)
{
- return sizeof example;
+ return sizeof example; /* expect: 144 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_145.c
diff -u src/tests/usr.bin/xlint/lint1/msg_145.c:1.2 src/tests/usr.bin/xlint/lint1/msg_145.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_145.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_145.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_145.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_145.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_145.c"
// Test for message: cannot take size/alignment of bit-field [145]
@@ -13,7 +13,7 @@ sizeof_one(void)
{
struct bits local_bits;
- return sizeof(local_bits.one);
+ return sizeof(local_bits.one); /* expect: 145 */
}
unsigned long
@@ -21,5 +21,5 @@ sizeof_eight(void)
{
struct bits local_bits;
- return sizeof(local_bits.eight);
+ return sizeof(local_bits.eight); /* expect: 145 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_146.c
diff -u src/tests/usr.bin/xlint/lint1/msg_146.c:1.2 src/tests/usr.bin/xlint/lint1/msg_146.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_146.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_146.c Sun Jan 31 11:12:07 2021
@@ -1,10 +1,10 @@
-/* $NetBSD: msg_146.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_146.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_146.c"
// Test for message: cannot take size/alignment of void [146]
-void
+unsigned long
example(void *ptr)
{
- return sizeof(*ptr);
+ return sizeof(*ptr); /* expect: 146 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_146.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_146.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_146.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_146.exp:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_146.exp Sun Jan 31 11:12:07 2021
@@ -1,2 +1 @@
msg_146.c(9): cannot take size/alignment of void [146]
-msg_146.c(9): void function example cannot return value [213]
Index: src/tests/usr.bin/xlint/lint1/msg_150.c
diff -u src/tests/usr.bin/xlint/lint1/msg_150.c:1.2 src/tests/usr.bin/xlint/lint1/msg_150.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_150.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_150.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_150.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_150.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_150.c"
// Test for message: argument mismatch: %d arg%s passed, %d expected [150]
@@ -9,5 +9,5 @@ add2(int, int);
int
example(void)
{
- return add2(2, 3, 5, 7);
+ return add2(2, 3, 5, 7); /* expect: 150 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_156.c
diff -u src/tests/usr.bin/xlint/lint1/msg_156.c:1.2 src/tests/usr.bin/xlint/lint1/msg_156.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_156.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_156.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_156.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_156.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_156.c"
// Test for message: enum type mismatch, arg #%d [156]
@@ -21,5 +21,5 @@ print_color(enum color);
void
example(void)
{
- print_color(MEDIUM);
+ print_color(MEDIUM); /* expect: 156 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_160.c
diff -u src/tests/usr.bin/xlint/lint1/msg_160.c:1.2 src/tests/usr.bin/xlint/lint1/msg_160.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_160.c:1.2 Sat Jan 9 15:32:06 2021
+++ src/tests/usr.bin/xlint/lint1/msg_160.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_160.c,v 1.2 2021/01/09 15:32:06 rillig Exp $ */
+/* $NetBSD: msg_160.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_160.c"
// Test for message: operator '==' found where '=' was expected [160]
@@ -9,5 +9,5 @@ _Bool
both_equal_or_unequal(int a, int b, int c, int d)
{
/* XXX: Why shouldn't this be legitimate? */
- return (a == b) == (c == d);
+ return (a == b) == (c == d); /* expect: 160, 160 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_164.c
diff -u src/tests/usr.bin/xlint/lint1/msg_164.c:1.2 src/tests/usr.bin/xlint/lint1/msg_164.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_164.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_164.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_164.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_164.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_164.c"
// Test for message: assignment of negative constant to unsigned type [164]
@@ -6,9 +6,9 @@
void
example(void)
{
- unsigned char uch = -3;
+ unsigned char uch = -3; /* expect: 164 */
- uch = -5;
- uch += -7;
- uch *= -1;
+ uch = -5; /* expect: 164 */
+ uch += -7; /* expect: 222 */
+ uch *= -1; /* expect: 222 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_165.c
diff -u src/tests/usr.bin/xlint/lint1/msg_165.c:1.2 src/tests/usr.bin/xlint/lint1/msg_165.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_165.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_165.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_165.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_165.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_165.c"
// Test for message: constant truncated by assignment [165]
@@ -8,5 +8,5 @@ example(void)
{
unsigned char ch;
- ch = 0x1234;
+ ch = 0x1234; /* expect: 165 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_167.c
diff -u src/tests/usr.bin/xlint/lint1/msg_167.c:1.2 src/tests/usr.bin/xlint/lint1/msg_167.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_167.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_167.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_167.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_167.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_167.c"
// Test for message: array subscript cannot be negative: %ld [167]
@@ -8,7 +8,7 @@ example(int *ptr)
{
int arr[6];
- arr[-3] = 13;
+ arr[-3] = 13; /* expect: 167 */
/*
* Since the pointer may have been initialized with "arr + 3",
Index: src/tests/usr.bin/xlint/lint1/msg_170.c
diff -u src/tests/usr.bin/xlint/lint1/msg_170.c:1.2 src/tests/usr.bin/xlint/lint1/msg_170.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_170.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_170.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_170.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_170.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_170.c"
// Test for message: first operand must have scalar type, op ? : [170]
@@ -8,7 +8,7 @@ struct number {
};
_Bool
-example(const struct number *num)
+example(const struct number *num) /* expect: 231 */
{
- return *num ? 1 : 0;
+ return *num ? 1 : 0; /* expect: 170, 214 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_172.c
diff -u src/tests/usr.bin/xlint/lint1/msg_172.c:1.2 src/tests/usr.bin/xlint/lint1/msg_172.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_172.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_172.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_172.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_172.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_172.c"
// Test for message: too many struct/union initializers [172]
@@ -9,4 +9,4 @@ struct color {
unsigned int blue: 8;
};
-struct color white = { 255, 255, 255, 255 };
+struct color white = { 255, 255, 255, 255 }; /* expect: 172 */
Index: src/tests/usr.bin/xlint/lint1/msg_173.c
diff -u src/tests/usr.bin/xlint/lint1/msg_173.c:1.2 src/tests/usr.bin/xlint/lint1/msg_173.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_173.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_173.c Sun Jan 31 11:12:07 2021
@@ -1,8 +1,8 @@
-/* $NetBSD: msg_173.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_173.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_173.c"
// Test for message: too many array initializers, expected %d [173]
-int arr_limited[3] = { 1, 2, 3, 4 };
+int arr_limited[3] = { 1, 2, 3, 4 }; /* expect: 173 */
int arr_unlimited[] = { 1, 2, 3, 4 };
int arr_too_few[] = { 1, 2 };
Index: src/tests/usr.bin/xlint/lint1/msg_174.c
diff -u src/tests/usr.bin/xlint/lint1/msg_174.c:1.2 src/tests/usr.bin/xlint/lint1/msg_174.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_174.c:1.2 Fri Jan 8 21:25:03 2021
+++ src/tests/usr.bin/xlint/lint1/msg_174.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_174.c,v 1.2 2021/01/08 21:25:03 rillig Exp $ */
+/* $NetBSD: msg_174.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_174.c"
// Test for message: too many initializers [174]
@@ -9,7 +9,7 @@ example(void)
/* A single pair of braces is always allowed. */
int n = { 13 };
- int too_many = { 17, 19 };
+ int too_many = { 17, 19 }; /* expect: 174 */
/* XXX: Double-check with C99, this might be allowed. */
int too_few = {};
Index: src/tests/usr.bin/xlint/lint1/msg_180.c
diff -u src/tests/usr.bin/xlint/lint1/msg_180.c:1.2 src/tests/usr.bin/xlint/lint1/msg_180.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_180.c:1.2 Thu Jan 7 18:37:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_180.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_180.c,v 1.2 2021/01/07 18:37:41 rillig Exp $ */
+/* $NetBSD: msg_180.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_180.c"
// Test for message: bit-field initializer does not fit [180]
@@ -7,6 +7,6 @@ struct example {
unsigned int a: 5;
unsigned int b: 5;
} example_var = {
- 32,
+ 32, /* expect: 180 */
31
};
Index: src/tests/usr.bin/xlint/lint1/msg_219.c
diff -u src/tests/usr.bin/xlint/lint1/msg_219.c:1.2 src/tests/usr.bin/xlint/lint1/msg_219.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_219.c:1.2 Sat Jan 2 11:12:34 2021
+++ src/tests/usr.bin/xlint/lint1/msg_219.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_219.c,v 1.2 2021/01/02 11:12:34 rillig Exp $ */
+/* $NetBSD: msg_219.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_219.c"
@@ -7,6 +7,6 @@
/* lint1-flags: -t -w */
char concat1[] = "one";
-char concat2[] = "one" "two";
-char concat3[] = "one" "two" "three";
-char concat4[] = "one" "two" "three" "four";
+char concat2[] = "one" "two"; /* expect: 219 */
+char concat3[] = "one" "two" "three"; /* expect: 219 */
+char concat4[] = "one" "two" "three" "four"; /* expect: 219 */
Index: src/tests/usr.bin/xlint/lint1/msg_221.c
diff -u src/tests/usr.bin/xlint/lint1/msg_221.c:1.2 src/tests/usr.bin/xlint/lint1/msg_221.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_221.c:1.2 Thu Jan 7 18:37:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_221.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_221.c,v 1.2 2021/01/07 18:37:41 rillig Exp $ */
+/* $NetBSD: msg_221.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_221.c"
// Test for message: initialisation of unsigned with negative constant [221]
@@ -7,6 +7,6 @@ struct example {
unsigned int a: 5;
unsigned int b: 5;
} example_var = {
- -1,
+ -1, /* expect: 221 */
31
};
Index: src/tests/usr.bin/xlint/lint1/msg_230.c
diff -u src/tests/usr.bin/xlint/lint1/msg_230.c:1.2 src/tests/usr.bin/xlint/lint1/msg_230.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_230.c:1.2 Sun Jan 3 15:35:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_230.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_230.c,v 1.2 2021/01/03 15:35:01 rillig Exp $ */
+/* $NetBSD: msg_230.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_230.c"
// Test for message: nonportable character comparison, op %s [230]
@@ -8,7 +8,7 @@
void example(char c, unsigned char uc, signed char sc)
{
if (c < 0)
- if (uc < 0)
+ if (uc < 0) /* expect: 162 */
if (sc < 0)
return;
@@ -19,8 +19,8 @@ void example(char c, unsigned char uc, s
* The comparisons may actually differ subtly because of the usual
* arithmetic promotions.
* */
- if (c <= -1)
- if (uc <= -1)
+ if (c <= -1) /* expect: 230 */
+ if (uc <= -1) /* expect: 162 */
if (sc <= -1)
return;
}
Index: src/tests/usr.bin/xlint/lint1/msg_232.c
diff -u src/tests/usr.bin/xlint/lint1/msg_232.c:1.2 src/tests/usr.bin/xlint/lint1/msg_232.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_232.c:1.2 Sun Jan 10 13:54:13 2021
+++ src/tests/usr.bin/xlint/lint1/msg_232.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_232.c,v 1.2 2021/01/10 13:54:13 rillig Exp $ */
+/* $NetBSD: msg_232.c,v 1.3 2021/01/31 11:12:07 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;
-unused_label:
+unused_label: /* expect: 232 */
return;
used_label:
return;
Index: src/tests/usr.bin/xlint/lint1/msg_265.c
diff -u src/tests/usr.bin/xlint/lint1/msg_265.c:1.2 src/tests/usr.bin/xlint/lint1/msg_265.c:1.3
--- src/tests/usr.bin/xlint/lint1/msg_265.c:1.2 Sun Jan 3 20:20:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_265.c Sun Jan 31 11:12:07 2021
@@ -1,13 +1,13 @@
-/* $NetBSD: msg_265.c,v 1.2 2021/01/03 20:20:01 rillig Exp $ */
+/* $NetBSD: msg_265.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_265.c"
/* Test for message: %s C does not support 'long long' [265] */
/* lint1-flags: -w */
-long long unsupported_variable;
+long long unsupported_variable; /* expect: 265 */
/*LONGLONG*/
long long suppressed_variable;
-long long another_unsupported_variable;
+long long another_unsupported_variable; /* expect: 265 */
Index: src/tests/usr.bin/xlint/lint1/msg_035.c
diff -u src/tests/usr.bin/xlint/lint1/msg_035.c:1.5 src/tests/usr.bin/xlint/lint1/msg_035.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_035.c:1.5 Sat Jan 2 17:17:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_035.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_035.c,v 1.5 2021/01/02 17:17:00 rillig Exp $ */
+/* $NetBSD: msg_035.c,v 1.6 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_035.c"
// Test for message: illegal bit-field type [35]
@@ -38,24 +38,24 @@ struct example {
unsigned short unsigned_short_flag: 1;
int int_flag: 1;
unsigned int unsigned_int_flag: 1;
- long long_flag: 1;
- unsigned long unsigned_long_flag: 1;
- long long long_long_flag: 1;
- unsigned long long unsigned_long_long_flag: 1;
+ long long_flag: 1; /* expect: 35 */
+ unsigned long unsigned_long_flag: 1; /* expect: 35 */
+ long long long_long_flag: 1; /* expect: 35 */
+ unsigned long long unsigned_long_long_flag: 1; /* expect: 35 */
/* __int128_t omitted since it is not always defined */
/* __uint128_t omitted since it is not always defined */
- float float_flag: 1;
- double double_flag: 1;
- long double long_double_flag: 1;
- void void_flag: 1;
- example_struct struct_flag: 1;
- example_union union_flag: 1;
+ float float_flag: 1; /* expect: 35 */
+ double double_flag: 1; /* expect: 35 */
+ long double long_double_flag: 1; /* expect: 35 */
+ void void_flag: 1; /* expect: 19, 37 */
+ example_struct struct_flag: 1; /* expect: 35 */
+ example_union union_flag: 1; /* expect: 35 */
example_enum enum_flag: 1;
- void *pointer_flag: 1;
- unsigned int array_flag[4]: 1;
- example_function function_flag: 1;
- _Complex complex_flag: 1;
- float _Complex float_complex_flag: 1;
- double _Complex double_complex_flag: 1;
- long double _Complex long_double_complex_flag: 1;
+ void *pointer_flag: 1; /* expect: 35 */
+ unsigned int array_flag[4]: 1; /* expect: 35 */
+ example_function function_flag: 1; /* expect: 35 */
+ _Complex complex_flag: 1; /* expect: 35, 308 */
+ float _Complex float_complex_flag: 1; /* expect: 35 */
+ double _Complex double_complex_flag: 1; /* expect: 35 */
+ long double _Complex long_double_complex_flag: 1; /* expect: 35 */
};
Index: src/tests/usr.bin/xlint/lint1/msg_108.c
diff -u src/tests/usr.bin/xlint/lint1/msg_108.c:1.3 src/tests/usr.bin/xlint/lint1/msg_108.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_108.c:1.3 Sat Jan 9 17:21:33 2021
+++ src/tests/usr.bin/xlint/lint1/msg_108.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_108.c,v 1.3 2021/01/09 17:21:33 rillig Exp $ */
+/* $NetBSD: msg_108.c,v 1.4 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_108.c"
// Test for message: operand of '%s' has incompatible type (%s != %s) [108]
@@ -21,5 +21,5 @@ complement_of_a_struct(void)
0
};
- s = ~s;
+ s = ~s; /* expect: 108 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_115.c
diff -u src/tests/usr.bin/xlint/lint1/msg_115.c:1.3 src/tests/usr.bin/xlint/lint1/msg_115.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_115.c:1.3 Sun Jan 17 16:19:54 2021
+++ src/tests/usr.bin/xlint/lint1/msg_115.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_115.c,v 1.3 2021/01/17 16:19:54 rillig Exp $ */
+/* $NetBSD: msg_115.c,v 1.4 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_115.c"
// Test for message: %soperand of '%s' must be modifiable lvalue [115]
@@ -7,11 +7,11 @@ void
example(const int *const_ptr)
{
- *const_ptr = 3;
- *const_ptr += 1;
- *const_ptr -= 4;
- *const_ptr *= 1;
- *const_ptr /= 5;
- *const_ptr %= 9;
- (*const_ptr)++;
+ *const_ptr = 3; /* expect: 115 */
+ *const_ptr += 1; /* expect: 115 */
+ *const_ptr -= 4; /* expect: 115 */
+ *const_ptr *= 1; /* expect: 115 */
+ *const_ptr /= 5; /* expect: 115 */
+ *const_ptr %= 9; /* expect: 115 */
+ (*const_ptr)++; /* expect: 115 */
}
Index: src/tests/usr.bin/xlint/lint1/msg_116.c
diff -u src/tests/usr.bin/xlint/lint1/msg_116.c:1.3 src/tests/usr.bin/xlint/lint1/msg_116.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_116.c:1.3 Sat Jan 9 22:55:36 2021
+++ src/tests/usr.bin/xlint/lint1/msg_116.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_116.c,v 1.3 2021/01/09 22:55:36 rillig Exp $ */
+/* $NetBSD: msg_116.c,v 1.4 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_116.c"
// Test for message: illegal pointer subtraction [116]
@@ -12,7 +12,7 @@
_Bool
example(int *a, double *b)
{
- return a - b > 0;
+ return a - b > 0; /* expect: 116 */
}
/*
@@ -24,7 +24,7 @@ example(int *a, double *b)
_Bool
subtract_character_pointers(signed char *scp, unsigned char *ucp)
{
- return scp - ucp > 0;
+ return scp - ucp > 0; /* expect: 116 */
}
_Bool
Index: src/tests/usr.bin/xlint/lint1/msg_308.c
diff -u src/tests/usr.bin/xlint/lint1/msg_308.c:1.3 src/tests/usr.bin/xlint/lint1/msg_308.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_308.c:1.3 Sat Jan 2 17:17:00 2021
+++ src/tests/usr.bin/xlint/lint1/msg_308.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_308.c,v 1.3 2021/01/02 17:17:00 rillig Exp $ */
+/* $NetBSD: msg_308.c,v 1.4 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_308.c"
// Test for message: Invalid type for _Complex [308]
@@ -6,5 +6,5 @@
float _Complex float_complex;
double _Complex double_complex;
long double _Complex long_double_complex;
-_Complex plain_complex;
-int _Complex int_complex;
+_Complex plain_complex; /* expect: 308 */
+int _Complex int_complex; /* expect: 308, 4 */
Index: src/tests/usr.bin/xlint/lint1/msg_169.c
diff -u src/tests/usr.bin/xlint/lint1/msg_169.c:1.4 src/tests/usr.bin/xlint/lint1/msg_169.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_169.c:1.4 Mon Jan 4 23:47:27 2021
+++ src/tests/usr.bin/xlint/lint1/msg_169.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_169.c,v 1.4 2021/01/04 23:47:27 rillig Exp $ */
+/* $NetBSD: msg_169.c,v 1.5 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_169.c"
// Test for message: precedence confusion possible: parenthesize! [169]
@@ -12,31 +12,31 @@ confusing_shift_arith(unsigned a, unsign
{
unsigned con, okl, okr;
- con = a + b << c;
+ con = a + b << c; /* expect: 169 */
okl = (a + b) << c;
okr = a + (b << c);
- con = a << b + c;
+ con = a << b + c; /* expect: 169 */
okl = (a << b) + c;
okr = a << (b + c);
- con = a - b >> c;
+ con = a - b >> c; /* expect: 169 */
okl = (a - b) >> c;
okr = a - (b >> c);
- con = a >> b - c;
+ con = a >> b - c; /* expect: 169 */
okl = (a >> b) - c;
okr = a >> (b - c);
// Parenthesizing the inner operands has no effect on the warning.
- con = (a) + b << c;
- con = a + (b) << c;
- con = a + b << (c);
+ con = (a) + b << c; /* expect: 169 */
+ con = a + (b) << c; /* expect: 169 */
+ con = a + b << (c); /* expect: 169 */
// The usual arithmetic promotions have no effect on the warning.
- con = ch + b << c;
- con = a + ch << c;
- con = a + b << ch;
+ con = ch + b << c; /* expect: 169 */
+ con = a + ch << c; /* expect: 169 */
+ con = a + b << ch; /* expect: 169 */
}
void
@@ -47,11 +47,11 @@ confusing_logical(bool a, bool b, bool c
eql = a && b && c;
eql = a || b || c;
- con = a && b || c;
+ con = a && b || c; /* expect: 169 */
okl = (a && b) || c;
okr = a && (b || c);
- con = a || b && c;
+ con = a || b && c; /* expect: 169 */
okl = (a || b) && c;
okr = a || (b && c);
}
@@ -65,40 +65,40 @@ confusing_bitwise(unsigned a, unsigned b
eql = a | b | c;
eql = a ^ b ^ c;
- con = a | b ^ c;
+ con = a | b ^ c; /* expect: 169 */
okl = (a | b) ^ c;
okr = a | (b ^ c);
- con = a | b & c;
+ con = a | b & c; /* expect: 169 */
okl = (a | b) & c;
okr = a | (b & c);
- con = a ^ b | c;
+ con = a ^ b | c; /* expect: 169 */
okl = (a ^ b) | c;
okr = a ^ (b | c);
- con = a ^ b & c;
+ con = a ^ b & c; /* expect: 169 */
okl = (a ^ b) & c;
okr = a ^ (b & c);
- con = a & b | c;
+ con = a & b | c; /* expect: 169 */
okl = (a & b) ^ c;
okr = a & (b ^ c);
- con = a & b ^ c;
+ con = a & b ^ c; /* expect: 169 */
okl = (a & b) ^ c;
okr = a & (b ^ c);
- con = a & b + c;
+ con = a & b + c; /* expect: 169 */
okl = (a & b) + c;
okr = a & (b + c);
- con = a - b | c;
+ con = a - b | c; /* expect: 169 */
okl = (a - b) | c;
okr = a - (b | c);
// This looks like a binomial formula but isn't.
- con = a ^ 2 - 2 * a * b + b ^ 2;
+ con = a ^ 2 - 2 * a * b + b ^ 2; /* expect: 169 */
// This isn't a binomial formula either since '^' means xor.
con = (a ^ 2) - 2 * a * b + (b ^ 2);
@@ -123,12 +123,12 @@ cast_expressions(char a, char b, char c)
// Adding casts to the leaf nodes doesn't change anything about the
// confusing precedence.
- con = (unsigned)a | (unsigned)b & (unsigned)c;
- con = (unsigned)a & (unsigned)b | (unsigned)c;
+ con = (unsigned)a | (unsigned)b & (unsigned)c; /* expect: 169 */
+ con = (unsigned)a & (unsigned)b | (unsigned)c; /* expect: 169 */
// Adding a cast around the whole calculation doesn't change the
// precedence as well.
- con = (unsigned)(a | b & c);
+ con = (unsigned)(a | b & c); /* expect: 169 */
// Adding a cast around an intermediate result groups the operands
// of the main node, which prevents any confusion about precedence.
@@ -146,20 +146,21 @@ expected_precedence(int a, int b, int c)
ok = a + b * c;
}
-/*
- * Before tree.c 1.132 from 2021-01-04, there was a typo in
- * check_precedence_confusion that prevented the right-hand operand from
- * being flagged as possibly confusing if there was an implicit conversion
- * or an explicit cast between the main operator ('|') and the nested
- * operator ('&').
- */
void
implicit_conversion_to_long(long la, int a)
{
int ok;
- ok = a & a | la; /* always marked as confusing */
- ok = la | a & a; /* marked as confusing since tree.c 1.132 */
+ ok = a & a | la; /* expect: 169 */
+
+ /*
+ * Before tree.c 1.132 from 2021-01-04, there was a typo in
+ * check_precedence_confusion that prevented the right-hand operand
+ * from being flagged as possibly confusing if there was an implicit
+ * conversion or an explicit cast between the main operator ('|') and
+ * the nested operator ('&').
+ */
+ ok = la | a & a; /* expect: 169 */
ok = (a & a) | la; /* always ok */
ok = la | (a & a); /* always ok */
Index: src/tests/usr.bin/xlint/lint1/msg_169.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_169.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_169.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_169.exp:1.4 Mon Jan 4 23:50:46 2021
+++ src/tests/usr.bin/xlint/lint1/msg_169.exp Sun Jan 31 11:12:07 2021
@@ -22,5 +22,5 @@ msg_169.c(101): warning: precedence conf
msg_169.c(126): warning: precedence confusion possible: parenthesize! [169]
msg_169.c(127): warning: precedence confusion possible: parenthesize! [169]
msg_169.c(131): warning: precedence confusion possible: parenthesize! [169]
-msg_169.c(161): warning: precedence confusion possible: parenthesize! [169]
-msg_169.c(162): warning: precedence confusion possible: parenthesize! [169]
+msg_169.c(154): warning: precedence confusion possible: parenthesize! [169]
+msg_169.c(163): warning: precedence confusion possible: parenthesize! [169]
Index: src/tests/usr.bin/xlint/lint1/msg_204.c
diff -u src/tests/usr.bin/xlint/lint1/msg_204.c:1.4 src/tests/usr.bin/xlint/lint1/msg_204.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_204.c:1.4 Sun Jan 17 14:45:21 2021
+++ src/tests/usr.bin/xlint/lint1/msg_204.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_204.c,v 1.4 2021/01/17 14:45:21 rillig Exp $ */
+/* $NetBSD: msg_204.c,v 1.5 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_204.c"
// Test for message: controlling expressions must have scalar type [204]
@@ -84,18 +84,18 @@ void if_enum(enum e e) { if (e) return
/* C99 6.2.5p20 */
void if_array(struct arr arr) { if (arr.arr) return; }
-void if_struct(struct s s) { if (s) return; }
-void if_union(union u u) { if (u) return; }
+void if_struct(struct s s) { if (s) return; } /* expect: 204, 231 */
+void if_union(union u u) { if (u) return; } /* expect: 204, 231 */
void if_function(void) { if (if_function) return; }
void if_pointer(void *p) { if (p) return; }
/* C99 6.8.5 */
-void while_struct(struct s s) { while (s) return; }
-void for_struct(struct s s) { for (;s;) return; }
-void do_while_struct(struct s s) { do { return; } while (s); }
+void while_struct(struct s s) { while (s) return; } /* expect: 204, 231 */
+void for_struct(struct s s) { for (;s;) return; } /* expect: 204, 223, 231 */
+void do_while_struct(struct s s) { do { return; } while (s); } /* expect: 204, 231 */
/*
* C99 6.5.15 for the '?:' operator does not explicitly mention that the
* controlling expression must have a scalar type, curiously.
*/
-int conditional_struct(struct s s) { return s ? 1 : 2; }
+int conditional_struct(struct s s) { return s ? 1 : 2; } /* expect: 170, 214, 231 */
Index: src/tests/usr.bin/xlint/lint1/msg_324.c
diff -u src/tests/usr.bin/xlint/lint1/msg_324.c:1.4 src/tests/usr.bin/xlint/lint1/msg_324.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_324.c:1.4 Wed Jan 6 09:23:04 2021
+++ src/tests/usr.bin/xlint/lint1/msg_324.c Sun Jan 31 11:12:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_324.c,v 1.4 2021/01/06 09:23:04 rillig Exp $ */
+/* $NetBSD: msg_324.c,v 1.5 2021/01/31 11:12:07 rillig Exp $ */
# 3 "msg_324.c"
// Test for message: suggest cast from '%s' to '%s' on op %s to avoid overflow [324]
@@ -22,13 +22,13 @@ example(char c, int i, unsigned u)
long long ll;
unsigned long long ull;
- ll = c + i;
- ll = i - c;
- ull = c * u;
- ull = u + c;
- ull = i - u;
- ull = u * i;
- ll = i << c;
+ ll = c + i; /* expect: 324 */
+ ll = i - c; /* expect: 324 */
+ ull = c * u; /* expect: 324 */
+ ull = u + c; /* expect: 324 */
+ ull = i - u; /* expect: 324 */
+ ull = u * i; /* expect: 324 */
+ ll = i << c; /* expect: 324 */
/*
* The operators SHR, DIV and MOD cannot produce an overflow,