Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: remove outdated assertion
details: https://anonhg.NetBSD.org/src/rev/0064de7e2f07
branches: trunk
changeset: 984343:0064de7e2f07
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jul 04 08:19:05 2021 +0000
description:
lint: remove outdated assertion
Since err.c 1.12 from 2000-07-06, lint allows to suppress individual
error messages. Suppressed error messages do not increment nerr.
Keeping nerr at 0 had triggered the assertion.
diffstat:
distrib/sets/lists/tests/mi | 4 ++--
tests/usr.bin/xlint/lint1/Makefile | 4 +---
tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c | 5 ++---
tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp | 5 -----
usr.bin/xlint/lint1/tree.c | 8 +++-----
5 files changed, 8 insertions(+), 18 deletions(-)
diffs (93 lines):
diff -r c1911418d243 -r 0064de7e2f07 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sun Jul 04 07:50:53 2021 +0000
+++ b/distrib/sets/lists/tests/mi Sun Jul 04 08:19:05 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1073 2021/07/04 07:50:53 rillig Exp $
+# $NetBSD: mi,v 1.1074 2021/07/04 08:19:05 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -6108,7 +6108,7 @@
./usr/tests/usr.bin/xlint/lint1/c11_generic_expression.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c11_generic_expression.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp tests-obsolete obsolete
./usr/tests/usr.bin/xlint/lint1/c99_init_array.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c99_init_array.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/c99_init_designator.c tests-usr.bin-tests compattestfile,atf
diff -r c1911418d243 -r 0064de7e2f07 tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile Sun Jul 04 07:50:53 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile Sun Jul 04 08:19:05 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.75 2021/07/04 07:50:53 rillig Exp $
+# $NetBSD: Makefile,v 1.76 2021/07/04 08:19:06 rillig Exp $
NOMAN= # defined
MAX_MESSAGE= 345 # see lint1/err.c
@@ -12,8 +12,6 @@
FILESDIR= ${TESTSDIR}
FILES+= c11_generic_expression.c
FILES+= c11_generic_expression.exp
-FILES+= c99_bool_strict_suppressed.c
-FILES+= c99_bool_strict_suppressed.exp
FILES+= c99_init_array.c
FILES+= c99_init_array.exp
FILES+= c99_init_designator.c
diff -r c1911418d243 -r 0064de7e2f07 tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c
--- a/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c Sun Jul 04 07:50:53 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c Sun Jul 04 08:19:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c99_bool_strict_suppressed.c,v 1.1 2021/07/04 07:50:53 rillig Exp $ */
+/* $NetBSD: c99_bool_strict_suppressed.c,v 1.2 2021/07/04 08:19:06 rillig Exp $ */
# 3 "c99_bool_strict_suppressed.c"
/*
@@ -17,8 +17,7 @@
* interaction with the assertion in expr().
*/
-/* lint1-extra-flags: -T */
-/* TODO: -X 107,330,331,332,333 */
+/* lint1-extra-flags: -T -X 107,330,331,332,333 */
/* ARGSUSED */
void
diff -r c1911418d243 -r 0064de7e2f07 tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp
--- a/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.exp Sun Jul 04 07:50:53 2021 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-c99_bool_strict_suppressed.c(29): error: controlling expression must be bool, not 'int' [333]
-c99_bool_strict_suppressed.c(33): error: operands of '=' have incompatible types (_Bool != int) [107]
-c99_bool_strict_suppressed.c(36): error: operand of '!' must be bool, not 'int' [330]
-c99_bool_strict_suppressed.c(39): error: left operand of '&&' must be bool, not 'int' [331]
-c99_bool_strict_suppressed.c(42): error: right operand of '&&' must be bool, not 'int' [332]
diff -r c1911418d243 -r 0064de7e2f07 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sun Jul 04 07:50:53 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sun Jul 04 08:19:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.304 2021/07/03 20:40:17 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.305 2021/07/04 08:19:06 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.304 2021/07/03 20:40:17 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.305 2021/07/04 08:19:06 rillig Exp $");
#endif
#include <float.h>
@@ -3682,9 +3682,7 @@
expr(tnode_t *tn, bool vctx, bool tctx, bool dofreeblk, bool is_do_while)
{
- lint_assert(tn != NULL || nerr != 0);
-
- if (tn == NULL) {
+ if (tn == NULL) { /* in case of errors */
expr_free_all();
return;
}
Home |
Main Index |
Thread Index |
Old Index