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 redundant test for negative...
details: https://anonhg.NetBSD.org/src/rev/c30202620131
branches: trunk
changeset: 1022876:c30202620131
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Aug 10 19:52:14 2021 +0000
description:
lint: remove redundant test for negative bit-field size
A bit-field can never have negative size. Its type is an unsigned
integer.
Strangely, GCC 10.3.0 only complains about this if the extra struct
level lint1_type.t_b is removed. Clang 12.0.1 does not complain at all.
diffstat:
usr.bin/xlint/lint1/decl.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 51ece6c7b2a6 -r c30202620131 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Tue Aug 10 17:57:16 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c Tue Aug 10 19:52:14 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.219 2021/08/03 21:18:24 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.220 2021/08/10 19:52:14 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.219 2021/08/03 21:18:24 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.220 2021/08/10 19:52:14 rillig Exp $");
#endif
#include <sys/param.h>
@@ -1151,7 +1151,7 @@
type_t *const tp = *inout_tp;
tspec_t const t = *inout_t;
- if (tp->t_flen < 0 || tp->t_flen > (ssize_t)size_in_bits(t)) {
+ if (tp->t_flen > size_in_bits(t)) {
/* illegal bit-field size: %d */
error(36, tp->t_flen);
tp->t_flen = size_in_bits(t);
Home |
Main Index |
Thread Index |
Old Index