Module Name:    src
Committed By:   rillig
Date:           Mon Jan 18 16:47:46 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: cgram.y scan.l

Log Message:
lint: replace abort with lint_assert


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.124 -r1.125 src/usr.bin/xlint/lint1/scan.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.148 src/usr.bin/xlint/lint1/cgram.y:1.149
--- src/usr.bin/xlint/lint1/cgram.y:1.148	Mon Jan 18 16:41:57 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Mon Jan 18 16:47:46 2021
@@ -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 @@ CLEAR_WARN_FLAGS(const char *file, size_
 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;

Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.124 src/usr.bin/xlint/lint1/scan.l:1.125
--- src/usr.bin/xlint/lint1/scan.l:1.124	Mon Jan 18 16:41:57 2021
+++ src/usr.bin/xlint/lint1/scan.l	Mon Jan 18 16:47:46 2021
@@ -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 @@ add_keyword(struct kwtab *kw, int deco)
 		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)

Reply via email to