Module Name: src Committed By: rillig Date: Mon Feb 7 02:35:09 UTC 2022
Modified Files: src/usr.sbin/ldpd: tlv.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/ldpd/tlv.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/ldpd/tlv.h diff -u src/usr.sbin/ldpd/tlv.h:1.4 src/usr.sbin/ldpd/tlv.h:1.5 --- src/usr.sbin/ldpd/tlv.h:1.4 Thu Jul 11 18:02:03 2013 +++ src/usr.sbin/ldpd/tlv.h Mon Feb 7 02:35:09 2022 @@ -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 @@ struct common_hello_tlv { 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 */