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: replace abort with lint_assert
details: https://anonhg.NetBSD.org/src/rev/dc514b1a2c07
branches: trunk
changeset: 958753:dc514b1a2c07
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Jan 18 16:47:46 2021 +0000
description:
lint: replace abort with lint_assert
diffstat:
usr.bin/xlint/lint1/cgram.y | 7 +++----
usr.bin/xlint/lint1/scan.l | 9 ++++-----
2 files changed, 7 insertions(+), 9 deletions(-)
diffs (63 lines):
diff -r e0dd6f459ca3 -r dc514b1a2c07 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Mon Jan 18 16:41:57 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Mon Jan 18 16:47:46 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.148 2021/01/18 16:41:57 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.149 2021/01/18 16:47:46 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.148 2021/01/18 16:41:57 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.149 2021/01/18 16:47:46 rillig Exp $");
#endif
#include <limits.h>
@@ -85,8 +85,7 @@
static void
SAVE_WARN_FLAGS(const char *file, size_t line)
{
- if (olwarn != LWARN_BAD)
- abort();
+ lint_assert(olwarn == LWARN_BAD);
printf("%s, %d: save flags %s %zu = %d\n", curr_pos.p_file,
curr_pos.p_line, file, line, lwarn);
olwarn = lwarn;
diff -r e0dd6f459ca3 -r dc514b1a2c07 usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l Mon Jan 18 16:41:57 2021 +0000
+++ b/usr.bin/xlint/lint1/scan.l Mon Jan 18 16:47:46 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: scan.l,v 1.124 2021/01/18 16:41:57 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.125 2021/01/18 16:47:46 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.124 2021/01/18 16:41:57 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.125 2021/01/18 16:47:46 rillig Exp $");
#endif
#include <ctype.h>
@@ -350,12 +350,11 @@
snprintf(buf, sizeof(buf), "__%s", kw->kw_name);
name = strdup(buf);
break;
- case 4:
+ default:
+ lint_assert(deco == 4);
snprintf(buf, sizeof(buf), "__%s__", kw->kw_name);
name = strdup(buf);
break;
- default:
- abort();
}
if (name == NULL)
Home |
Main Index |
Thread Index |
Old Index