Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ldpd ldpd: remove unused bit-field member from anon...



details:   https://anonhg.NetBSD.org/src/rev/f8d0eaedeecf
branches:  trunk
changeset: 359997:f8d0eaedeecf
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 07 02:35:09 2022 +0000

description:
ldpd: remove unused bit-field member from anonymous union

The struct common_hello_tlv contained an anonymous union, which is a C11
feature.  That union contained a bit-field, which is very unusual since
the C standards answer basically all interesting questions about
bit-fields in unions with "implementation-defined" or "unspecified".
GCC passes these questions further down by saying "Determined by ABI".

This was the only occurrence of a bit-field union member in the whole
NetBSD tree, and it caused the lint diagnostic 41 to be downgraded from
error to warning on 2021-09-17 since this exotic construct is allowed by
the C standards but practically unused.

No binary change.

diffstat:

 usr.sbin/ldpd/tlv.h |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (22 lines):

diff -r 23f7695e2693 -r f8d0eaedeecf usr.sbin/ldpd/tlv.h
--- a/usr.sbin/ldpd/tlv.h       Sun Feb 06 22:21:25 2022 +0000
+++ b/usr.sbin/ldpd/tlv.h       Mon Feb 07 02:35:09 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tlv.h,v 1.4 2013/07/11 18:02:03 kefren Exp $ */
+/* $NetBSD: tlv.h,v 1.5 2022/02/07 02:35:09 rillig Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -69,11 +69,7 @@
        uint16_t       type;
        uint16_t       length;
        uint16_t       holdtime;
-       union {
-               /* XXX: Endianness ?! */
-               uint8_t        tr:2;
-               uint16_t       res;
-       };
+       uint16_t       res;
 }               __packed;
 
 /* Hello TLV structure */



Home | Main Index | Thread Index | Old Index