diff options
| author | rillig <rillig@NetBSD.org> | 2023-07-07 06:03:31 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2023-07-07 06:03:31 +0000 |
| commit | f260bdb92f361d3b4e3ab9d23e5f0eb4faafd698 (patch) | |
| tree | ab7115a0d2c19d8f3c540e8afc852a7403b759f7 | |
| parent | eed2e1f5f354b83b1e2723c0412ffdf22f00d4e8 (diff) | |
lint: only skip 'unused' warnings after errors, not other warnings
Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that. This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.
Fixed by counting the errors and the warnings separately and only
combining them if actually desired.
25 files changed, 60 insertions, 44 deletions
diff --git a/tests/usr.bin/xlint/lint1/d_init_array_using_string.c b/tests/usr.bin/xlint/lint1/d_init_array_using_string.c index ea288f701d6..468485589b6 100644 --- a/tests/usr.bin/xlint/lint1/d_init_array_using_string.c +++ b/tests/usr.bin/xlint/lint1/d_init_array_using_string.c @@ -1,11 +1,11 @@ -/* $NetBSD: d_init_array_using_string.c,v 1.13 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: d_init_array_using_string.c,v 1.14 2023/07/07 06:03:31 rillig Exp $ */ # 3 "d_init_array_using_string.c" /* * Test initialization of arrays and pointers by string literals. */ -/* lint1-extra-flags: -X 351 */ +/* lint1-extra-flags: -X 191,351 */ void sink(const void *); diff --git a/tests/usr.bin/xlint/lint1/decl.c b/tests/usr.bin/xlint/lint1/decl.c index 4f8185f1a42..e35146a690b 100644 --- a/tests/usr.bin/xlint/lint1/decl.c +++ b/tests/usr.bin/xlint/lint1/decl.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.21 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.22 2023/07/07 06:03:31 rillig Exp $ */ # 3 "decl.c" /* @@ -6,7 +6,7 @@ * declaration-specifiers and the declarators. */ -/* lint1-extra-flags: -X 351 */ +/* lint1-extra-flags: -X 191,351 */ /* * Even though 'const' comes after 'char' and is therefore quite close to the diff --git a/tests/usr.bin/xlint/lint1/gcc_attribute_var.c b/tests/usr.bin/xlint/lint1/gcc_attribute_var.c index 7e9c09a6b98..eb97162d3b8 100644 --- a/tests/usr.bin/xlint/lint1/gcc_attribute_var.c +++ b/tests/usr.bin/xlint/lint1/gcc_attribute_var.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_attribute_var.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: gcc_attribute_var.c,v 1.9 2023/07/07 06:03:31 rillig Exp $ */ # 3 "gcc_attribute_var.c" /* @@ -52,6 +52,7 @@ void println(void); void ambiguity_for_attribute(void) { + /* expect+1: warning: 'var1' unused in function 'ambiguity_for_attribute' [192] */ __attribute__((unused)) _Bool var1; switch (1) { diff --git a/tests/usr.bin/xlint/lint1/msg_011.c b/tests/usr.bin/xlint/lint1/msg_011.c index 9a284445d78..fe9176fa091 100644 --- a/tests/usr.bin/xlint/lint1/msg_011.c +++ b/tests/usr.bin/xlint/lint1/msg_011.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_011.c,v 1.5 2021/08/26 19:23:25 rillig Exp $ */ +/* $NetBSD: msg_011.c,v 1.6 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_011.c" // Test for message: bit-field initializer out of range [11] @@ -9,6 +9,7 @@ example(void) struct { signed int si: 3; unsigned int ui: 3; + /* expect+1: warning: 's' set but not used in function 'example' [191] */ } s[] = { /* expect+2: warning: bit-field initializer out of range [11] */ /* expect+1: warning: initialization of unsigned with negative constant [221] */ diff --git a/tests/usr.bin/xlint/lint1/msg_083.c b/tests/usr.bin/xlint/lint1/msg_083.c index e309c863ad1..7aa9ec36cf1 100644 --- a/tests/usr.bin/xlint/lint1/msg_083.c +++ b/tests/usr.bin/xlint/lint1/msg_083.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_083.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: msg_083.c,v 1.7 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_083.c" // Test for message: storage class after type is obsolescent [83] @@ -8,6 +8,7 @@ void example(void) { + /* expect+2: warning: 'x' unused in function 'example' [192] */ /* expect+1: warning: storage class after type is obsolescent [83] */ int register x; } diff --git a/tests/usr.bin/xlint/lint1/msg_090.c b/tests/usr.bin/xlint/lint1/msg_090.c index 15f85133b0c..a3238315547 100644 --- a/tests/usr.bin/xlint/lint1/msg_090.c +++ b/tests/usr.bin/xlint/lint1/msg_090.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_090.c,v 1.6 2023/03/28 20:04:52 rillig Exp $ */ +/* $NetBSD: msg_090.c,v 1.7 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_090.c" // Test for message: inconsistent redeclaration of extern '%s' [90] @@ -10,6 +10,7 @@ extern int random_number(void); void use(void) { + /* expect+3: warning: 'random_number' unused in function 'use' [192] */ /* expect+2: warning: nested 'extern' declaration of 'random_number' [352] */ /* expect+1: warning: inconsistent redeclaration of extern 'random_number' [90] */ extern int random_number(int); diff --git a/tests/usr.bin/xlint/lint1/msg_092.c b/tests/usr.bin/xlint/lint1/msg_092.c index 532df56b32b..581895429f8 100644 --- a/tests/usr.bin/xlint/lint1/msg_092.c +++ b/tests/usr.bin/xlint/lint1/msg_092.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_092.c,v 1.4 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: msg_092.c,v 1.5 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_092.c" // Test for message: inconsistent redeclaration of static '%s' [92] @@ -14,6 +14,7 @@ use_random(void) { random(); + /* expect+3: warning: 'random' unused in function 'use_random' [192] */ /* expect+2: warning: dubious static function 'random' at block level [93] */ /* expect+1: warning: inconsistent redeclaration of static 'random' [92] */ static double random(void); diff --git a/tests/usr.bin/xlint/lint1/msg_095.c b/tests/usr.bin/xlint/lint1/msg_095.c index cac45ae939a..5e83b6d42c1 100644 --- a/tests/usr.bin/xlint/lint1/msg_095.c +++ b/tests/usr.bin/xlint/lint1/msg_095.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_095.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: msg_095.c,v 1.7 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_095.c" // Test for message: declaration of '%s' hides earlier one [95] @@ -12,6 +12,7 @@ example(int identifier) { { + /* expect+2: warning: 'identifier' set but not used in function 'example' [191] */ /* expect+1: warning: declaration of 'identifier' hides earlier one [95] */ int identifier = 3; } diff --git a/tests/usr.bin/xlint/lint1/msg_097.c b/tests/usr.bin/xlint/lint1/msg_097.c index 78cd05e3d53..ff0195af53a 100644 --- a/tests/usr.bin/xlint/lint1/msg_097.c +++ b/tests/usr.bin/xlint/lint1/msg_097.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_097.c,v 1.4 2022/04/03 09:34:45 rillig Exp $ */ +/* $NetBSD: msg_097.c,v 1.5 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_097.c" /* Test for message: suffix U is illegal in traditional C [97] */ -/* lint1-flags: -gtw */ +/* lint1-flags: -gtw -X 191 */ void example() diff --git a/tests/usr.bin/xlint/lint1/msg_124.c b/tests/usr.bin/xlint/lint1/msg_124.c index ebf80f3636b..0a73db62fb4 100644 --- a/tests/usr.bin/xlint/lint1/msg_124.c +++ b/tests/usr.bin/xlint/lint1/msg_124.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_124.c,v 1.13 2023/03/28 14:44:34 rillig Exp $ */ +/* $NetBSD: msg_124.c,v 1.14 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_124.c" // Test for message: illegal combination of '%s' and '%s', op '%s' [124] -/* lint1-extra-flags: -s -X 351 */ +/* lint1-extra-flags: -s -X 191,351 */ typedef void(*signal_handler)(int); diff --git a/tests/usr.bin/xlint/lint1/msg_128.c b/tests/usr.bin/xlint/lint1/msg_128.c index d585bbc1f17..cd93367635d 100644 --- a/tests/usr.bin/xlint/lint1/msg_128.c +++ b/tests/usr.bin/xlint/lint1/msg_128.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_128.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_128.c,v 1.6 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_128.c" // Test for message: operands of '%s' have incompatible pointer types to '%s' and '%s' [128] @@ -7,6 +7,7 @@ void conversion_to_unconst(const char *cstr) { char *str; + /* expect+2: warning: 'str' set but not used in function 'conversion_to_unconst' [191] */ /* expect+1: warning: operands of '=' have incompatible pointer types to 'char' and 'const char' [128] */ str = cstr; } diff --git a/tests/usr.bin/xlint/lint1/msg_165.c b/tests/usr.bin/xlint/lint1/msg_165.c index 01b83dea1a3..e8fdd600a21 100644 --- a/tests/usr.bin/xlint/lint1/msg_165.c +++ b/tests/usr.bin/xlint/lint1/msg_165.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_165.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_165.c,v 1.5 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_165.c" // Test for message: constant truncated by assignment [165] @@ -8,6 +8,7 @@ example(void) { unsigned char ch; + /* expect+2: warning: 'ch' set but not used in function 'example' [191] */ /* expect+1: warning: constant truncated by assignment [165] */ ch = 0x1234; } diff --git a/tests/usr.bin/xlint/lint1/msg_169.c b/tests/usr.bin/xlint/lint1/msg_169.c index 60da15d18eb..98f4b816ce3 100644 --- a/tests/usr.bin/xlint/lint1/msg_169.c +++ b/tests/usr.bin/xlint/lint1/msg_169.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_169.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ +/* $NetBSD: msg_169.c,v 1.8 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_169.c" // Test for message: precedence confusion possible: parenthesize! [169] -/* lint1-flags: -g -h -S -w -X 351 */ +/* lint1-flags: -g -h -S -w -X 191,351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_182.c b/tests/usr.bin/xlint/lint1/msg_182.c index 924c1cd952e..0b620ef9569 100644 --- a/tests/usr.bin/xlint/lint1/msg_182.c +++ b/tests/usr.bin/xlint/lint1/msg_182.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_182.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_182.c,v 1.5 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_182.c" // Test for message: incompatible pointer types to '%s' and '%s' [182] @@ -13,6 +13,7 @@ return_discarding_volatile(volatile void *arg) void init_discarding_volatile(volatile void *arg) { + /* expect+2: warning: 'array' set but not used in function 'init_discarding_volatile' [191] */ /* expect+1: warning: incompatible pointer types to 'void' and 'volatile void' [182] */ void *array[] = { arg }; } diff --git a/tests/usr.bin/xlint/lint1/msg_188.c b/tests/usr.bin/xlint/lint1/msg_188.c index c2284a5b0e7..c9f9b67b212 100644 --- a/tests/usr.bin/xlint/lint1/msg_188.c +++ b/tests/usr.bin/xlint/lint1/msg_188.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_188.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ +/* $NetBSD: msg_188.c,v 1.6 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_188.c" /* Test for message: no automatic aggregate initialization in traditional C [188] */ @@ -18,6 +18,7 @@ struct point global = { void function() { + /* expect+2: warning: 'local' set but not used in function 'function' [191] */ /* expect+1: warning: no automatic aggregate initialization in traditional C [188] */ struct point local = { 3, diff --git a/tests/usr.bin/xlint/lint1/msg_240.c b/tests/usr.bin/xlint/lint1/msg_240.c index 6b06d166ea3..a697a66d65a 100644 --- a/tests/usr.bin/xlint/lint1/msg_240.c +++ b/tests/usr.bin/xlint/lint1/msg_240.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_240.c,v 1.4 2022/07/01 20:53:13 rillig Exp $ */ +/* $NetBSD: msg_240.c,v 1.5 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_240.c" // Test for message: assignment of different structures (%s != %s) [240] @@ -32,6 +32,7 @@ return_other_struct(struct s_arg s_arg) void assign_other_struct(struct s_arg s_arg) { + /* expect+1: warning: 's_local' unused in function 'assign_other_struct' [192] */ static struct s_local s_local; /* XXX: No warning? */ s_local = s_arg; diff --git a/tests/usr.bin/xlint/lint1/msg_247.c b/tests/usr.bin/xlint/lint1/msg_247.c index 0fc12320adb..a14c3319143 100644 --- a/tests/usr.bin/xlint/lint1/msg_247.c +++ b/tests/usr.bin/xlint/lint1/msg_247.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_247.c,v 1.30 2023/07/05 11:36:56 rillig Exp $ */ +/* $NetBSD: msg_247.c,v 1.31 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_247.c" // Test for message: pointer cast from '%s' to '%s' may be troublesome [247] @@ -308,6 +308,7 @@ void * cast_between_first_member_struct(void *ptr) { /* Before tree.c 1.462 from 2022-06-24, lint warned about this cast. */ + /* expect+1: warning: 't1' set but not used in function 'cast_between_first_member_struct' [191] */ void *t1 = (ctl_node_t *)(ctl_named_node_t *)ptr; void *t2 = (ctl_named_node_t *)(ctl_node_t *)ptr; diff --git a/tests/usr.bin/xlint/lint1/msg_277.c b/tests/usr.bin/xlint/lint1/msg_277.c index 9ef7d2a8c33..502088169ae 100644 --- a/tests/usr.bin/xlint/lint1/msg_277.c +++ b/tests/usr.bin/xlint/lint1/msg_277.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_277.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ +/* $NetBSD: msg_277.c,v 1.8 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_277.c" // Test for message: initialization of '%s' with '%s' [277] @@ -27,7 +27,9 @@ example(enum E e, int i) sink_int(i2); sink_int(i3); + /* expect+1: warning: 'init_0' set but not used in function 'example' [191] */ enum E init_0 = 0; + /* expect+2: warning: 'init_1' set but not used in function 'example' [191] */ /* expect+1: warning: initialization of 'enum E' with 'int' [277] */ enum E init_1 = 1; } diff --git a/tests/usr.bin/xlint/lint1/msg_324.c b/tests/usr.bin/xlint/lint1/msg_324.c index 288319e3b9d..5dd0d7e8aad 100644 --- a/tests/usr.bin/xlint/lint1/msg_324.c +++ b/tests/usr.bin/xlint/lint1/msg_324.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_324.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_324.c,v 1.8 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_324.c" // Test for message: suggest cast from '%s' to '%s' on op '%s' to avoid overflow [324] @@ -22,10 +22,12 @@ example(char c, int i, unsigned u) long long ll; unsigned long long ull; + /* expect+2: warning: 'll' set but not used in function 'example' [191] */ /* expect+1: warning: suggest cast from 'int' to 'long long' on op '+' to avoid overflow [324] */ ll = c + i; /* expect+1: warning: suggest cast from 'int' to 'long long' on op '-' to avoid overflow [324] */ ll = i - c; + /* expect+2: warning: 'ull' set but not used in function 'example' [191] */ /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '*' to avoid overflow [324] */ ull = c * u; /* expect+1: warning: suggest cast from 'unsigned int' to 'unsigned long long' on op '+' to avoid overflow [324] */ diff --git a/tests/usr.bin/xlint/lint1/msg_327.c b/tests/usr.bin/xlint/lint1/msg_327.c index 3e69cf50749..3e01dce2bbf 100644 --- a/tests/usr.bin/xlint/lint1/msg_327.c +++ b/tests/usr.bin/xlint/lint1/msg_327.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_327.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ +/* $NetBSD: msg_327.c,v 1.8 2023/07/07 06:03:31 rillig Exp $ */ # 3 "msg_327.c" /* Test for message: declarations after statements is a C99 feature [327] */ -/* lint1-flags: -w -X 351 */ +/* lint1-flags: -w -X 192,351 */ void statement(void); diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c index 55fbb025402..03ae41acc9c 100644 --- a/usr.bin/xlint/lint1/decl.c +++ b/usr.bin/xlint/lint1/decl.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.341 2023/07/03 10:23:12 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.342 2023/07/07 06:03:31 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: decl.c,v 1.341 2023/07/03 10:23:12 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.342 2023/07/07 06:03:31 rillig Exp $"); #endif #include <sys/param.h> @@ -2935,7 +2935,7 @@ check_variable_usage(bool novar, sym_t *sym) return; /* errors in expressions easily cause lots of these warnings */ - if (nerr != 0) + if (seen_error) return; /* diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index db6a1891e09..4a009cee293 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.204 2023/07/02 23:40:23 rillig Exp $ */ +/* $NetBSD: err.c,v 1.205 2023/07/07 06:03:31 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: err.c,v 1.204 2023/07/02 23:40:23 rillig Exp $"); +__RCSID("$NetBSD: err.c,v 1.205 2023/07/07 06:03:31 rillig Exp $"); #endif #include <limits.h> @@ -47,8 +47,8 @@ __RCSID("$NetBSD: err.c,v 1.204 2023/07/02 23:40:23 rillig Exp $"); #include "lint1.h" -/* number of errors found */ -int nerr; +bool seen_error; +bool seen_warning; /* number of syntax errors */ int sytxerr; @@ -529,7 +529,7 @@ verror_at(int msgid, const pos_t *pos, va_list ap) (void)printf("%s(%d): error: ", fn, pos->p_line); (void)vprintf(msgs[msgid], ap); (void)printf(" [%d]\n", msgid); - nerr++; + seen_error = true; print_stack_trace(); } @@ -550,8 +550,7 @@ vwarning_at(int msgid, const pos_t *pos, va_list ap) (void)printf("%s(%d): warning: ", fn, pos->p_line); (void)vprintf(msgs[msgid], ap); (void)printf(" [%d]\n", msgid); - if (wflag) - nerr++; + seen_warning = true; print_stack_trace(); } diff --git a/usr.bin/xlint/lint1/externs1.h b/usr.bin/xlint/lint1/externs1.h index 712b7a4dc32..66924a1395f 100644 --- a/usr.bin/xlint/lint1/externs1.h +++ b/usr.bin/xlint/lint1/externs1.h @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.188 2023/07/02 23:40:23 rillig Exp $ */ +/* $NetBSD: externs1.h,v 1.189 2023/07/07 06:03:31 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -156,7 +156,8 @@ void debug_leave_func(const char *); /* * err.c */ -extern int nerr; +extern bool seen_error; +extern bool seen_warning; extern int sytxerr; extern bool any_query_enabled; diff --git a/usr.bin/xlint/lint1/main1.c b/usr.bin/xlint/lint1/main1.c index c115ebef102..c5be6198dd9 100644 --- a/usr.bin/xlint/lint1/main1.c +++ b/usr.bin/xlint/lint1/main1.c @@ -1,4 +1,4 @@ -/* $NetBSD: main1.c,v 1.71 2023/07/03 11:16:32 rillig Exp $ */ +/* $NetBSD: main1.c,v 1.72 2023/07/07 06:03:31 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: main1.c,v 1.71 2023/07/03 11:16:32 rillig Exp $"); +__RCSID("$NetBSD: main1.c,v 1.72 2023/07/07 06:03:31 rillig Exp $"); #endif #include <sys/types.h> @@ -258,7 +258,7 @@ main(int argc, char *argv[]) outclose(); - return nerr != 0 ? 1 : 0; + return seen_error || (wflag && seen_warning) ? 1 : 0; } static void __attribute__((noreturn)) diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index c86812ec726..5eaefd5f87e 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.547 2023/07/03 21:36:16 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.548 2023/07/07 06:03:31 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.547 2023/07/03 21:36:16 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.548 2023/07/07 06:03:31 rillig Exp $"); #endif #include <float.h> @@ -4336,7 +4336,7 @@ integer_constant(tnode_t *tn, bool required) val_t *v = xcalloc(1, sizeof(*v)); if (tn == NULL) { - lint_assert(nerr != 0); + lint_assert(seen_error); debug_step("constant node is null; returning 1 instead"); v->v_tspec = INT; v->u.integer = 1; |
