Module Name: src
Committed By: rillig
Date: Mon Aug 16 18:51:03 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: remove dead code from check_bad_enum_operation
There is a single caller of that function, and it checks the exact same
condition beforehand.
To generate a diff of this commit:
cvs rdiff -u -r1.336 -r1.337 src/usr.bin/xlint/lint1/tree.c
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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.336 src/usr.bin/xlint/lint1/tree.c:1.337
--- src/usr.bin/xlint/lint1/tree.c:1.336 Sun Aug 15 14:26:39 2021
+++ src/usr.bin/xlint/lint1/tree.c Mon Aug 16 18:51:03 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.336 2021/08/15 14:26:39 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.337 2021/08/16 18:51:03 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.336 2021/08/15 14:26:39 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.337 2021/08/16 18:51:03 rillig Exp $");
#endif
#include <float.h>
@@ -1587,11 +1587,6 @@ check_bad_enum_operation(op_t op, const
if (!eflag)
return;
- if (!(ln->tn_type->t_is_enum ||
- (modtab[op].m_binary && rn->tn_type->t_is_enum))) {
- return;
- }
-
/*
* Enum as offset to a pointer is an exception (otherwise enums
* could not be used as array indices).
@@ -1604,7 +1599,6 @@ check_bad_enum_operation(op_t op, const
/* dubious operation on enum, op %s */
warning(241, op_name(op));
-
}
/*